tethys.core.networks.network_base

Module Contents

class tethys.core.networks.network_base.NetworkBase[source]

Bases: tethys.core.regobjs.regobj_base.RegistrableObjectBase

Base abstract class for the Networks

property input_nodes(self) → Iterable['NodeBase'][source]

It returns input nodes [abstract property]

Example:

<in> —> Node1 —> Node2 —> <out>

Node1 - input node

Returns

list of the input nodes

Return type

Iterable[NodeBase]

property output_nodes(self) → Iterable['NodeBase'][source]

It returns output nodes [abstract property]

Example:

<in> —> Node1 —> Node2 —> <out>

Node2 - output node (because –> <out>)

Returns

list of the output nodes

Return type

Iterable[NodeBase]

property input_pipes(self) → Iterable['PipeBase'][source]

It returns input pipes [abstract property]

Example:

<in> –pipe1–> N –pipe2–> N –pipe3–> <out>

pipe1 - input pipe

Returns

list of the input pipes

Return type

Iterable[PipeBase]

property output_pipes(self) → Iterable['PipeBase'][source]

It returns input pipes [abstract property]

Example:

<in> –pipe1–> N –pipe2–> N –pipe3–> <out> <–pipe4– N

pipe3 and pipe4 - output pipes

Returns

list of the output pipes

Return type

Iterable[PipeBase]

abstract get_pipes_map(self, reverse: bool = False, **kwargs) → Dict[str, Dict[str, Dict[str, 'PipeBase']]][source]

It returns pipes map like 3d array

Parameters

reverse (bool) – if true then 3d array -> map[“node_b_id”][“node_a_id”][“pipe_id”]

Returns

return 3d array -> map[“node_a_id”][“node_b_id”][“pipe_id”] = PipeBase()

Return type

Dict[str, Dict[str, Dict[str, PipeBase]]]

abstract add_pipes(self, *pipes: Iterable[Union['PipeBase', str]], **kwargs)[source]

It adds pipes to the Network

Parameters

pipes (Iterable[Union[PipeBase, str]]) – list of args of the pipes (str or PipeBase instances)

abstract remove_pipes(self, *pipes: Iterable[Union['PipeBase', str]], **kwargs)[source]

It removes pipes from the Network

Parameters

pipes (Iterable[Union[PipeBase, str]]) – list of args of the pipes (str or PipeBase instances)