NetworkModelResult

NetworkModelResult(data, *, name=None, item=None, quantity=None, aux_items=None)

Model result for a network of nodes and reaches.

Construct one from a result file, or from a :class:mikeio1d.network.Network already built. Observations name the location they sit at, and no spatial interpolation is performed.

Nothing is read when the model result is built. :meth:extract reads the series of the one location an observation names, so matching a handful of sensors against a large model reads a handful of locations.

Parameters

Name Type Description Default
data (Network, str or Path) Path to a .res1d, .res11 or .res result file, or a :class:mikeio1d.network.Network. required
name str The name of the model result, by default None (will be set to the item name) None
item str | int | None If multiple items/arrays are present in the input an item must be given (as either an index or a string), by default None None
quantity Quantity Model quantity None
aux_items list[int | str] Auxiliary items, by default None None

Examples

>>> import modelskill as ms
>>> mr = ms.NetworkModelResult("model.res1d", item="WaterLevel")
>>> obs = ms.NodeObservation(data, at="node_A")
>>> extracted = mr.extract(obs)

Open the network yourself to name an EPANET .resx companion:

>>> from mikeio1d.network import Network
>>> network = Network.open("model.res", companions=["model.resx"])
>>> mr = ms.NetworkModelResult(network, item="Head", name="MyModel")

Notes

The network is used as given, not copied, so mr.network is the caller’s object. It reads from its result file on every :meth:extract.

See Also

mikeio1d.network.Network.open : Read a network from a result file.

Attributes

Name Description
period First and last timestep of the result file.

Methods

Name Description
extract Extract ModelResult at exact node or reach locations

extract

NetworkModelResult.extract(observation)

Extract ModelResult at exact node or reach locations

Parameters

Name Type Description Default
observation NodeObservation or ReachObservation observation naming a node, a breakpoint, or a reach required

Returns

Name Type Description
NodeModelResult extracted model result