ResSimpy.Nexus.DataModels.Network.NexusNodes.NexusNodes
- class ResSimpy.Nexus.DataModels.Network.NexusNodes.NexusNodes(parent_network: 'NexusNetwork')[source]
Bases:
NodesPublic Data Attributes:
Start of the Node definition table.
End of the Node definition table.
Inherited from
NetworkOperationsMixIntable_headertable_footerMethods:
__init__(parent_network)get_all()Returns a list of nodes loaded from the simulator.
get_by_name(node_name)Returns a single node with the provided name loaded from the simulator.
get_df()Creates a dataframe representing all processed node data in a surface file :returns: DataFrame -- of the properties of the nodes through time with each row representing a node.
get_overview()load(surface_file, start_date, default_units)Calls load nodes and appends the list of discovered nodes into the NexusNodes object.
remove(node_to_remove)Remove a node from the network based on the properties matching a dictionary or id.
add(node_to_add)Adds a node to a network, taking a dictionary with properties for the new node.
modify(node_to_modify, new_properties)Modifies an existing node based on a matching dictionary of properties (partial matches allowed if precisely
__repr__()Return repr(self).
__eq__(other)Return self==value.
Inherited from
Nodes__init__(*[, _Nodes__nodes])__repr__()Return repr(self).
__eq__(other)Return self==value.
Inherited from
NetworkOperationsMixIn__init__(parent_network)get_all()get_by_name(name)get_df()get_overview()load(file, start_date, default_units)remove(obj_to_remove)add(obj_to_add)modify(obj_to_modify, new_properties)
- __init__(parent_network: NexusNetwork) None[source]
- property table_header: str
Start of the Node definition table.
End of the Node definition table.
- get_by_name(node_name: str) NexusNode | None[source]
Returns a single node with the provided name loaded from the simulator.
Args:
node_name (str): name of the requested node
Returns:
NexusNode: which has the same name as the requested node_name
- get_df() pandas.DataFrame[source]
Creates a dataframe representing all processed node data in a surface file :returns: DataFrame – of the properties of the nodes through time with each row representing a node.
- load(surface_file: File, start_date: str, default_units: UnitSystem) None[source]
Calls load nodes and appends the list of discovered nodes into the NexusNodes object.
- Parameters:
surface_file (File) – NexusFile representation of the surface file.
start_date (str) – Starting date of the run
default_units (UnitSystem) – Units used in case not specified by surface file.
- Raises:
TypeError – if the unit system found in the property check is not a valid enum UnitSystem.
- remove(node_to_remove: dict[str, None | str | float | int] | UUID) None[source]
Remove a node from the network based on the properties matching a dictionary or id.
- Parameters:
node_to_remove (UUID | dict[str, None | str | float | int]) – UUID of the node to remove or a dictionary with sufficient matching parameters to uniquely identify a node
- add(node_to_add: dict[str, None | str | float | int]) None[source]
Adds a node to a network, taking a dictionary with properties for the new node.
- Parameters:
node_to_add (dict[str, None | str | float | int]) – dictionary taking all the properties for the new node.
name. (Requires date and a node) –
- modify(node_to_modify: dict[str, None | str | float | int], new_properties: dict[str, None | str | float | int]) None[source]
- Modifies an existing node based on a matching dictionary of properties (partial matches allowed if precisely
1 matching node is found). Updates the properties with properties in the new_properties dictionary.
- Parameters:
node_to_modify (dict[str, None | str | float | int]) – dictionary containing attributes to match in the
set. (existing node) –
new_properties (dict[str, None | str | float | int]) – properties to switch to in the new node