Workflow step
workflow_step
¶
A wrapping of a BaseTool in a GEMSEO Discipline to enable running workflows of
tools.
Classes¶
Input
dataclass
¶
Input(name: str = '', option_key: str = '')
Input(name: 'str' = '', option_key: 'str' = '')
Output
dataclass
¶
Output(name: str = '', attr_name: str = '')
Output(name: 'str' = '', attr_name: 'str' = '')
WorkflowStep
¶
WorkflowStep(
name: str,
tool_name: str,
tool_settings: BaseSettings,
tool_constructor_options: dict | None = None,
inputs: Iterable[Input] = (),
outputs: Iterable[Output] = (),
)
Bases: Discipline
The base class for disciplines.
The :meth:.execute method is used to do compute output data from input data.
The :meth:.linearize method can be used
to compute the Jacobian of the differentiable outputs
with respect to differentiated inputs.
The :attr:.jac stores this Jacobian.
This method can evaluate the true derivatives (default)
if the :meth:_compute_jacobian method is implemented
or approximated the derivatives,
depending on the :attr:.linearization_mode
(one of :attr:.LinearizationMode).
Initialize self. See help(type(self)) for accurate signature.
Parameters:
-
name(str) –The name of the discipline. If empty, use the name of the class.
-
tool_name(str) –The description is missing.
-
tool_settings(BaseSettings) –The description is missing.
-
tool_constructor_options(dict | None, default:None) –The description is missing.
-
inputs(Iterable[Input], default:()) –The description is missing.
-
outputs(Iterable[Output], default:()) –The description is missing.
Source code in src\vimseo\workflow\workflow_step.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
Functions:¶
deserialize_pydantic_settings
¶
deserialize_pydantic_settings(
input_settings: Mapping[str, Any],
)
Reconstruct the fields of a BaseSettings as Pydantic model instance if they
are of this type.
Only the case of nested Pydantic model fields in dictionaries is handled:
class MySettings(BaseSettings):
pydantic_field: MyPydanticField = MyPydanticField
nested_pydantic_field: Mapping[str, MyPydanticField] = {}
double_nested_pydantic_field: Mapping[str, Mapping[str, MyPydanticField]] = {}
The case of lists of Pydantic fields is not handled.
Source code in src\vimseo\workflow\workflow_step.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
serialize_pydantic_settings
¶
serialize_pydantic_settings(
input_settings: BaseSettings,
attr_names: Iterable[str] = (),
)
Serialize (JSON compatible) a BaseSettings Pydantic model defining a tool
settings.
It handles the case where a field of BaseSettings is a Pydantic model.
This field is serialized as a dictionary obtained with my_field.model_dump(),
and the item {'pydantic_model': field_module.field_class_name} is added to
this dictionary.
It allows to be able to reconstruct the field as a Pydantic model instance later.
Source code in src\vimseo\workflow\workflow_step.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |