pyiron_workflow.io module

Collections of channel objects.

These also support the syntactic sugar of treating value assignments and new connections on the same footing.

class pyiron_workflow.io.DataIO(*channels: OwnedType)[source]

Bases: IO[DataChannel, DataChannel], ABC

activate_strict_hints()[source]
deactivate_strict_hints()[source]
property ready: bool
to_list() list[Any][source]

A list of channel values (order not guaranteed)

to_value_dict() dict[str, Any][source]
class pyiron_workflow.io.GenericOutputs(*channels: OwnedType)[source]

Bases: OutputsIO, DataIO, Generic[OutputDataType], ABC

class pyiron_workflow.io.IO(*channels: OwnedType)[source]

Bases: HasStateDisplay, Generic[OwnedType, OwnedConjugate], ABC

IO is a convenience layer for holding and accessing multiple input/output channels. It allows key and dot-based access to the underlying channels. Channels can also be iterated over, and there are a number of helper functions to alter the properties of or check the status of all the channels at once.

A new channel can be assigned as an attribute of an IO collection, as long as it matches the channel’s type (e.g. OutputChannel for Outputs, InputChannel for Inputs, etc…).

When assigning something to an attribute holding an existing channel, if the assigned object is a Channel, then an attempt is made to make a connection between the two channels, otherwise we fall back on a value assignment that must be defined in child classes under _assign_value_to_existing_channel. This provides syntactic sugar such that both new connections and new values can be assigned with a simple =.

channel_dict: DotDict[str, OwnedType]
property connected: bool
property connections: list[OwnedConjugate]

All the unique connections across all channels

disconnect() list[tuple[OwnedType, OwnedConjugate]][source]

Disconnect all connections that owned channels have.

Returns:

A list of the pairs of channels that no

longer participate in a connection.

Return type:

[list[tuple[Channel, Channel]]]

display_state(state: dict[str, Any] | None = None, ignore_private: bool = True) dict[str, Any][source]

A dictionary of JSON-compatible objects based on the object state (plus whatever modifications to the state the class designer has chosen to make).

Anything that fails to dump to JSON gets cast as a string and then dumped.

Parameters:
  • state (dict|None) – The starting state. Default is None which uses __getstate__, but available in case child classes want to first sanitize the state values.

  • ignore_private (bool) – Whether to ignore or include any state element whose key starts with ‘_’. Default is True, only show public data.

Return type:

dict

property fully_connected: bool
items() ItemsView[str, OwnedType][source]
property labels: list[str]
class pyiron_workflow.io.InputSignals(*channels: OwnedType)[source]

Bases: InputsIO, SignalIO

disconnect_run() list[tuple[InputSignal, OutputSignal]][source]

Disconnect all run and accumulate_and_run signals, if they exist.

class pyiron_workflow.io.Inputs(*channels: OwnedType)[source]

Bases: InputsIO, DataIO

fetch() None[source]
class pyiron_workflow.io.InputsIO(*channels: OwnedType)[source]

Bases: IO[InputType, OutputType], ABC

class pyiron_workflow.io.OutputSignals(*channels: OwnedType)[source]

Bases: OutputsIO, SignalIO

class pyiron_workflow.io.Outputs(*channels: OwnedType)[source]

Bases: GenericOutputs[OutputData]

class pyiron_workflow.io.OutputsIO(*channels: OwnedType)[source]

Bases: IO[OutputType, InputType], ABC

class pyiron_workflow.io.SignalIO(*channels: OwnedType)[source]

Bases: IO[SignalChannel, SignalChannel], ABC

class pyiron_workflow.io.Signals[source]

Bases: HasStateDisplay

A meta-container for input and output signal IO containers.

input

An empty input signals IO container.

Type:

InputSignals

output

An empty input signals IO container.

Type:

OutputSignals

property connected: bool
disconnect() list[tuple[SignalChannel, SignalChannel]][source]

Disconnect all connections in input and output signals.

Returns:

A list of the pairs of channels that no

longer participate in a connection.

Return type:

[list[tuple[Channel, Channel]]]

disconnect_run() list[tuple[InputSignal, OutputSignal]][source]
property fully_connected: bool