network.ReachBreakPoint

network.ReachBreakPoint()

Abstract base class for an intermediate break point along a network reach.

Break points represent locations between the start and end nodes of a reach (e.g. cross-section chainage points along a river reach) that carry their own time-series data.

Two properties must be implemented:

  • :attr:id - a (reach_id, distance) tuple that uniquely locates the break point within the network. distance may be None when the break point’s position along the reach is genuinely unknown (e.g. a link-node reach with no known length).
  • :attr:data - a time-indexed :class:pandas.DataFrame whose columns are quantity names.

The :attr:distance convenience property returns id[1] (the position along the reach in the units used by the parent network, or None if unknown). It need not be measured from the start node: a MIKE river reach reports its chainage, which is a coordinate along the whole branch, so the distance from the start node is distance - reach.start_distance. A break point with an unknown distance cannot be looked up via find(reach=..., distance=<number>), but still has a graph node of its own, so it carries data and recall() names it.

Examples

Minimal subclass:

>>> class MyBreakPoint(ReachBreakPoint):
...     def __init__(self, reach_id, chainage, df):
...         self._id = (reach_id, chainage)
...         self._data = df
...     @property
...     def id(self): return self._id
...     @property
...     def data(self): return self._data

See Also

NetworkReach : Owns a list of ReachBreakPoint instances. NetworkNode : Represents a start/end node of a reach. Network : Assembles reaches (and their break points) into a graph.

Attributes

Name Description
data Time-indexed DataFrame with one column per quantity.
distance Position along the reach, in the reach’s own frame, or None if unknown.
id (reach_id, distance) tuple uniquely identifying this break point.
quantities List of quantity names available at this break point.