ResSimpy.Nexus.DataModels.Network.NexusTargets.NexusTargets

class ResSimpy.Nexus.DataModels.Network.NexusTargets.NexusTargets(parent_network: 'NexusNetwork')[source]

Bases: Targets

Public Data Attributes:

table_header

Start of the target definition table.

table_footer

End of the target definition table.

Inherited from NetworkOperationsMixIn

table_header

table_footer

Methods:

__init__(parent_network)

get_all()

Returns a list of targets loaded from the simulator.

get_by_name(target_name)

Returns a single target with the provided name loaded from the simulator.

get_df()

Creates a dataframe representing all processed target data in a surface file :returns: DataFrame -- of the properties of the targets through time with each row representing a target.

get_overview()

load(surface_file, start_date, default_units)

Calls load target and appends the list of discovered nodes into the NexusTargets object.

remove(target_to_remove)

Remove a node from the network based on the properties matching a dictionary or id.

add(target_to_add)

Adds a target to a network, taking a dictionary with properties for the new node.

modify(target_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 Targets

__init__(*[, _Targets__targets])

__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 target definition table.

End of the target definition table.

get_all() Sequence[NexusTarget][source]

Returns a list of targets loaded from the simulator.

get_by_name(target_name: str) NexusTarget | None[source]

Returns a single target with the provided name loaded from the simulator.

Args:

target_name (str): name of the requested node

Returns:

NexusTarget: which has the same name as the requested target_name

get_df() pandas.DataFrame[source]

Creates a dataframe representing all processed target data in a surface file :returns: DataFrame – of the properties of the targets through time with each row representing a target.

load(surface_file: File, start_date: str, default_units: UnitSystem) None[source]

Calls load target and appends the list of discovered nodes into the NexusTargets 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(target_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:

target_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(target_to_add: dict[str, None | str | float | int]) None[source]

Adds a target to a network, taking a dictionary with properties for the new node.

Parameters:
  • target_to_add (dict[str, None | str | float | int]) –

  • target. (dictionary taking all the properties for the new) –

  • name. (Requires date and a target) –

modify(target_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:
  • target_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