Package sabx10 :: Package map :: Module elevations :: Class SegmentAccumulator
[hide private]
[frames] | no frames]

Class SegmentAccumulator

source code

object --+
         |
        SegmentAccumulator

Gather all the values we're interested in for a ride by extracting them from the processed segments and accumulating them.

Instance Methods [hide private]
 
__init__(self)
Initialize all values for the ride.
source code
 
accumulate_segment(self, seg)
Extract all relevant values from the given segment processor and add them to the instance variables.
source code
dict
create_element(self)
Create a dictionary that can be used by Jinja2 to present this data.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
list climbs
list of "top" climbs for the ride
float distance
length of the ride
float fall_dist
length of part of the ride descending
float fall_height
cumulative descent in this ride
float rise_dist
length of part of the ride ascending
float rise_height
cumulative ascent in this ride
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initialize all values for the ride.

Overrides: object.__init__

accumulate_segment(self, seg)

source code 

Extract all relevant values from the given segment processor and add them to the instance variables.

Parameters:

create_element(self)

source code 

Create a dictionary that can be used by Jinja2 to present this data. Calculate the values that haven't been accumulated.

The dictionary contains the following data:

  • length: length of ride
  • net_height: net change in elevation over ride
  • rise_height: height of climbing in ride
  • rise_dist: distance spent climbing in ride
  • rise_grade: average grade of climbing in ride
  • fall_height: height of descending in ride
  • fall_dist: distance spent descending in ride
  • fall_grade: average grade of descending in ride
  • climbs: list with climbs, their grades, and their lengths in ride
Returns: dict
presentable data