network.NetworkLocation
network.NetworkLocation(self, address, quantities, graph_node)A location a network has, as :meth:Network.resolve answers for it.
Attributes
| Name | Type | Description |
|---|---|---|
| address | str or tuple[str, float] | The network’s own spelling of the location, which the rest of the network takes. A position is the one the file stores, not the one asked for. |
| quantities | tuple of str | The quantity IDs readable there. Empty is an answer: the location is in the network but carries nothing of its own. |
| graph_node | int | The integer :meth:Network.to_networkx and :meth:Network.to_dataset label the location with, which graph.nodes[graph_node]["address"] turns back into the address. Every location has one, a breakpoint too. |
Examples
>>> from mikeio1d.network import Network
>>> network = Network.open("tests/testdata/network.res1d")
>>> location = network.resolve(("100l1", 23.8), position_tol=0.1)
>>> location.address, location.quantities
(('100l1', 23.8413574216414), ('Discharge',))
>>> network.to_networkx().nodes[location.graph_node]["address"]
('100l1', 23.8413574216414)