4.2.5. Linker¶
-
class
pyprom.lib.containers.linker.Linker(summit, saddle, path=<WalkPath> 0 Objects, id=None)[source]¶ A Linker links one single
pyprom.lib.locations.summit.Summitwith one singlepyprom.lib.locations.saddle.Saddle-
__eq__(other)[source]¶ Determines if this object is equal to another.
Parameters: other ( Linker) –Linkerto be compared againstReturns: equality Return type: bool Raises: TypeError if other not of Linker
-
__hash__()[source]¶ Produces the hash representation of this object.
Returns: Hash representation of this object Return type: str
-
__init__(summit, saddle, path=<WalkPath> 0 Objects, id=None)[source]¶ Parameters: - summit (
pyprom.lib.locations.summit.Summit) – Summit this linker links. - saddle (
pyprom.lib.locations.saddle.Saddle) – Saddle this linker links. - path (
pyprom.lib.containers.walkpath.WalkPath) – data containing the path taken to link this Summit and Saddle - id (str) – id for this object.
- summit (
-
__ne__(other)[source]¶ Determines if this object is not equal to another.
Parameters: other ( Linker) –Linkerto be compared againstReturns: inequality Return type: bool Raises: TypeError if other not of Linker
-
__str__()¶ Returns: String representation of this object
-
__unicode__()¶ Returns: String representation of this object
-
__weakref__¶ list of weak references to the object (if defined)
-
_help_exclude_self(linker, excludeSelf)[source]¶ Determine if this
Linkeris to be included in list.Parameters: - linker –
Linker - excludeSelf (bool) – exclude self from results.
Returns: If this linker is to be included in a list.
Return type: bool
- linker –
-
add_to_remote_saddle_and_summit(ignoreDuplicates=True)[source]¶ Safely adds this linker to the remote
pyprom.lib.locations.saddle.Saddleandpyprom.lib.locations.summit.SummitParameters: ignoreDuplicates (bool) – if True, will not add self to feature if already present.
-
classmethod
from_dict(linkerDict, saddlesContainer, summitsContainer)[source]¶ Create this object from dictionary representation
Returns: a new Linker Return type: Linker
-
linkers_to_saddles_connected_via_summit(excludeSelf=True, skipDisqualified=True)[source]¶ Returns linkers linking Saddles to the Summit this linker links.
Parameters: - exclude (bool) – exclude this linker from results.
- skipDisqualified (bool) – If true, do not return disqualified linkers
Returns: list of linkers to saddles connected to the summit this linker links
Return type: list(
Linker)
-
linkers_to_summits_connected_via_saddle(excludeSelf=True, skipDisqualified=True)[source]¶ Returns linkers linking Summits to the Saddle this linker links.
Parameters: - exclude (bool) – exclude this linker from results.
- skipDisqualified (bool) – If true, do not return disqualified linkers
Returns: list of linkers to summits connected to the saddle this linker links
Return type: list(
Linker)
-
prom¶ Calculates how much higher the summit is than the Saddle in meters
Returns: altitude difference between saddle and summit in meters. Return type: float, int
-
prom_ft¶ Calculates how much higher the summit is than the Saddle in feet
Returns: altitude difference between saddle and summit in feet. Return type: float, int
-
saddles_connected_via_summit(skipDisqualified=True, exemptLinkers={})[source]¶ Returns all saddles connected to the
pyprom.lib.locations.summit.Summitthat thisLinkerlinks.Parameters: - skipDisqualified (bool) – If true, disregard disqualified remote linkers.
- exemptLinkers (dict(linker.id: bool)) – hash of linkers regarded as dead.
Returns: list of Saddles
:rtype list(
pyprom.lib.locations.saddle.Saddle)
-
summits_connected_via_saddle(skipDisqualified=True, exemptLinkers={})[source]¶ Returns all summits connected to the
pyprom.lib.locations.saddle.Saddlethat thisLinkerlinks.Parameters: - skipDisqualified (bool) – If true, disregard disqualified remote linkers.
- exemptLinkers (dict(linker.id: bool)) – hash of linkers regarded as dead.
Returns: list of Summits
Return type:
-