network.NetworkReach

network.NetworkReach(
    self,
    id,
    start,
    end,
    length=None,
    start_position=0.0,
    breakpoints=(),
)

A directed connection between two nodes, and the breakpoints along it.

Attributes

Name Type Description
id str The id the model gave the reach, unique within the network. A structure’s reach keeps the type prefix its file gives it, such as "Weir:119w1" or "Pump:115p1", which keeps a weir and a pump that share an id apart.
start, end str The ids of the start (upstream) and end (downstream) nodes.
length float or None Total length in network units, or None where it is undefined. Reach length matters in some domains (rivers, sewer networks) and not in others (link-node water distribution models).
start_position float Position of the start node, in the frame :attr:breakpoints are placed in. Zero where they are measured from the reach’s own start; a MIKE river reach places them at their chainage, so it can begin thousands of metres in - or below zero.
breakpoints tuple of (str, float) The addresses of the breakpoints along the reach, each a (reach_id, position) pair as :meth:Network.read takes it. Ascending by position; consecutive differences are edge lengths. A reach with breakpoints gets its own chain of graph nodes. A reach with none is a single start-to-end edge, and :class:Network refuses two of those between the same pair of nodes.

Examples

>>> from mikeio1d.network import Network
>>> network = Network.open("tests/testdata/network.res1d")
>>> network.reaches["100l1"]
NetworkReach(id='100l1', start='100', end='99', length=47.6827148432828,
    start_position=0.0, breakpoints=(('100l1', 0.0), ('100l1', 23.8413574216414),
    ('100l1', 47.6827148432828)))

A breakpoint is an address as it stands:

>>> network.read([(network.reaches["100l1"].breakpoints[1], "Discharge")]).shape
(110, 1)