hpcflow.sdk.core.parameters.AbstractInputValue#

class hpcflow.sdk.core.parameters.AbstractInputValue(_workflow=None, _element_set=None, _schema_input=None, _value=None, _value_group_idx=None)#

Bases: JSONLike

Class to represent all sequence-able inputs to a task.

Methods

from_json_like

Make an instance of this class from JSON (or YAML) data.

make_persistent

Save value to a persistent workflow.

to_dict

Serialize this object as a dictionary.

to_json_like

Serialize this object as an object structure that can be trivially converted to JSON.

Attributes

normalised_path

The normalised path, if known.

value

The value itself.

workflow

The workflow containing this input value.

Parameters:
classmethod from_json_like(json_like, shared_data=None)#

Make an instance of this class from JSON (or YAML) data.

Parameters:
  • json_like (str | Mapping[str, JSONed] | Sequence[Mapping[str, JSONed]] | None) – The data to deserialise.

  • shared_data (Mapping[str, ObjectList[JSONable]] | None) – Shared context data.

Return type:

The deserialised object.

make_persistent(workflow, source)#

Save value to a persistent workflow.

Returns:

  • str – Normalised path for this task input.

  • list[int | list[int]] – The index of the parameter data Zarr group where the data is stored.

  • bool – Whether this is newly persistent.

Parameters:
Return type:

tuple[str, list[int | list[int]], bool]

property normalised_path: str#

The normalised path, if known.

to_dict()#

Serialize this object as a dictionary.

Return type:

dict[str, Any]

to_json_like(dct=None, shared_data=None, exclude=(), path=None)#

Serialize this object as an object structure that can be trivially converted to JSON. Note that YAML can also be produced from the result of this method; it just requires a different final serialization step.

Parameters:
  • dct (dict[str, JSONable] | None) –

  • shared_data (_JSONDeserState) –

  • exclude (Container[str | None]) –

  • path (list | None) –

Return type:

tuple[JSONDocument, _JSONDeserState]

property value: Any#

The value itself.

property workflow: Workflow | None#

The workflow containing this input value.