NetworkModelResult

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

Model result for network data with time and node dimensions.

Construct a NetworkModelResult from a Network object containing timeseries data for each node. Users must provide exact node IDs (integers obtained via Network.find()) when creating observations — no spatial interpolation is performed.

Parameters

Name Type Description Default
data Network Network-like object with a to_dataset() method (e.g. :class:modelskill.network.Network). required
name str The name of the model result, by default None (will be set to first data variable 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
>>> from modelskill.network import Network
>>> network = Network(edges)  # edges is a list[NetworkEdge]
>>> mr = ms.NetworkModelResult(network, name="MyModel")
>>> obs = ms.NodeObservation(data, node=network.find(node="node_A"))
>>> extracted = mr.extract(obs)

Attributes

Name Description
nodes Return the node IDs as a numpy array of integers.
time Return the time coordinate as a pandas.DatetimeIndex.

Methods

Name Description
extract Extract ModelResult at exact node locations

extract

NetworkModelResult.extract(observation)

Extract ModelResult at exact node locations

Parameters

Name Type Description Default
observation NodeObservation observation with node ID (only NodeObservation supported) required

Returns

Name Type Description
NodeModelResult extracted model result