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.Summit with one single pyprom.lib.locations.saddle.Saddle

__eq__(other)[source]

Determines if this object is equal to another.

Parameters:other (Linker) – Linker to be compared against
Returns: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:
__ne__(other)[source]

Determines if this object is not equal to another.

Parameters:other (Linker) – Linker to be compared against
Returns:inequality
Return type:bool
Raises:TypeError if other not of Linker
__repr__()[source]
Returns:String representation of this object
__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 Linker is to be included in list.

Parameters:
  • linkerLinker
  • excludeSelf (bool) – exclude self from results.
Returns:

If this linker is to be included in a list.

Return type:

bool

add_to_remote_saddle_and_summit(ignoreDuplicates=True)[source]

Safely adds this linker to the remote pyprom.lib.locations.saddle.Saddle and pyprom.lib.locations.summit.Summit

Parameters: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.Summit that this Linker links.

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.Saddle that this Linker links.

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:

list(pyprom.lib.locations.summit.Summit)

to_dict(referenceById=True, noWalkPath=True)[source]

Create the dictionary representation of this object.

Parameters:
  • referenceById (bool) – only use ID of linked objects.
  • noWalkPath (bool) – exclude WalkPath
Returns:

dict() representation of Linker

Return type:

dict()