openlr_dereferencer.observer package¶
Submodules¶
openlr_dereferencer.observer.abstract module¶
Contains the abstract observer class for the decoder
-
class
openlr_dereferencer.observer.abstract.
DecoderObserver
[source]¶ Bases:
object
Abstract class representing an observer to the OpenLR decoding process
-
on_candidates_found
(lrp: openlr.locations.LocationReferencePoint, candidates: Sequence[openlr_dereferencer.decoding.candidate.Candidate])[source]¶ Called by the decoder when it finds a list of candidates for a location reference point
-
on_matching_fail
(from_lrp: openlr.locations.LocationReferencePoint, to_lrp: openlr.locations.LocationReferencePoint, from_candidates: Sequence[openlr_dereferencer.decoding.candidate.Candidate], to_candidates: Sequence[openlr_dereferencer.decoding.candidate.Candidate])[source]¶ Called after none of the candidate pairs for two LRPs were matching.
The only way of recovering is to go back and discard the last bit of the dereferencedd line location, if possible.
-
on_route_fail
(from_lrp: openlr.locations.LocationReferencePoint, to_lrp: openlr.locations.LocationReferencePoint, from_line: openlr_dereferencer.maps.abstract.Line, to_line: openlr_dereferencer.maps.abstract.Line)[source]¶ Called after the decoder fails to find a route between two candidate lines for successive location reference points
-
on_route_success
(from_lrp: openlr.locations.LocationReferencePoint, to_lrp: openlr.locations.LocationReferencePoint, from_line: openlr_dereferencer.maps.abstract.Line, to_line: openlr_dereferencer.maps.abstract.Line, path: Sequence[openlr_dereferencer.maps.abstract.Line])[source]¶ Called after the decoder successfully finds a route between two candidate lines for successive location reference points
-
openlr_dereferencer.observer.simple_observer module¶
Contains a simple DecoderObserver implementation
-
class
openlr_dereferencer.observer.simple_observer.
AttemptedMatch
[source]¶ Bases:
tuple
An attempted try to resolve a pair of two LRPs
-
from_candidate
¶ Alias for field number 2
-
from_lrp
¶ Alias for field number 0
-
to_candidate
¶ Alias for field number 3
-
to_lrp
¶ Alias for field number 1
-
-
class
openlr_dereferencer.observer.simple_observer.
AttemptedRoute
[source]¶ Bases:
tuple
An attempted route between two lrps
-
from_line
¶ Alias for field number 2
-
from_lrp
¶ Alias for field number 0
-
path
¶ Alias for field number 5
-
success
¶ Alias for field number 4
-
to_line
¶ Alias for field number 3
-
to_lrp
¶ Alias for field number 1
-
-
class
openlr_dereferencer.observer.simple_observer.
SimpleObserver
[source]¶ Bases:
openlr_dereferencer.observer.abstract.DecoderObserver
A simple observer that collects the information and can be queried after the decoding process is finished
-
on_candidates_found
(lrp: openlr.locations.LocationReferencePoint, candidates: Sequence[openlr_dereferencer.decoding.candidate.Candidate])[source]¶ Called by the decoder when it finds a list of candidates for a location reference point
-
on_matching_fail
(from_lrp: openlr.locations.LocationReferencePoint, to_lrp: openlr.locations.LocationReferencePoint, from_candidates: Sequence[openlr_dereferencer.decoding.candidate.Candidate], to_candidates: Sequence[openlr_dereferencer.decoding.candidate.Candidate])[source]¶ Called after none of the candidate pairs for two LRPs were matching.
The only way of recovering is to go back and discard the last bit of the dereferencedd line location, if possible.
-
on_route_fail
(from_lrp: openlr.locations.LocationReferencePoint, to_lrp: openlr.locations.LocationReferencePoint, from_line: openlr_dereferencer.maps.abstract.Line, to_line: openlr_dereferencer.maps.abstract.Line)[source]¶ Called after the decoder fails to find a route between two candidate lines for successive location reference points
-
on_route_success
(from_lrp: openlr.locations.LocationReferencePoint, to_lrp: openlr.locations.LocationReferencePoint, from_line: openlr_dereferencer.maps.abstract.Line, to_line: openlr_dereferencer.maps.abstract.Line, path: Sequence[openlr_dereferencer.maps.abstract.Line])[source]¶ Called after the decoder successfully finds a route between two candidate lines for successive location reference points
-
Module contents¶
Decoder observer package.