src.pydasa.workflows.basic#

Base class for common attributes and methods shared across all workflow PyDASA workflow management.

Classes:

WorkflowBase: Base class for all workflow orchestrators with common analysis components and validation methods.

Attributes#

Variables

accepts Variable instances or dicts.

Coefficients

accepts Coefficient instances or dicts.

FDUs

accepts framework strings, Schema objects, or FDU definitions.

Classes#

WorkflowBase

WorkflowBase Base class for PyDASA workflow orchestrators. Provides common attributes and validation methods shared across:

Module Contents#

src.pydasa.workflows.basic.Variables#

accepts Variable instances or dicts.

Type:

Type hint for variables input

src.pydasa.workflows.basic.Coefficients#

accepts Coefficient instances or dicts.

Type:

Type hint for coefficients input

src.pydasa.workflows.basic.FDUs#

accepts framework strings, Schema objects, or FDU definitions.

Type:

Type hint for schema input

class src.pydasa.workflows.basic.WorkflowBase#
WorkflowBase Base class for PyDASA workflow orchestrators. Provides common attributes and validation methods shared across:
  • AnalysisEngine: Dimensional analysis workflow (phenomena.py)

  • SensitivityAnalysis: Sensitivity analysis workflow (influence.py)

  • MonteCarloSimulation: Monte Carlo experiments workflow (practical.py)

_variables#

All variables in the model.

Type:

Dict[str, Variable]

_schema#

Dimensional framework schema.

Type:

Optional[Schema]

_coefficients#

All coefficients in the model.

Type:

Dict[str, Coefficient]

_results#

Consolidated results from workflow.

Type:

Dict[str, Dict[str, Any]]

_is_solved#

Flag indicating if the workflow has been solved.

Type:

bool

_variables: Dict[str, pydasa.elements.parameter.Variable]#

All variables in the workflow.

_schema: pydasa.dimensional.vaschy.Schema | None = None#

Dimensional framework schema for the workflow. After __post_init__, this will always be a Schema instance.

_coefficients: Dict[str, pydasa.dimensional.buckingham.Coefficient]#

Generated coefficients in the workflow.

_results: Dict[str, Dict[str, Any]]#

Consolidated results from workflow.

_is_solved: bool = False#

Flag indicating if the workflow has been solved.

_convert_to_objects(data, tgt_cls)#

_convert_to_objects() Converts dictionary values to target class instances (Variable or Coefficient). Accepts either existing instances or dicts to convert.

Parameters:
  • data (Dict[str, Any]) – Input dictionary with values to convert.

  • tgt_cls (type) – Target class to convert values to (Variable or Coefficient).

Raises:

ValueError – If any value is neither the target class nor a dict.

Returns:

Dictionary with values converted to target class instances.

Return type:

Dict[str, Any]

_convert_to_schema(val)#
_convert_to_schema() Converts various schema input formats to a Schema instance. Accepts:
  • str: Framework name (e.g., “PHYSICAL”), load known schema

  • Schema: Direct Schema instance

  • Dict: Complete Schema dict or single FDU definition

  • List[Dict]: Multiple FDU definitions for CUSTOM framework

Parameters:

val (FDUs) – Schema in various formats.

Raises:
Returns:

Converted Schema instance.

Return type:

Schema

property variables: Dict[str, pydasa.elements.parameter.Variable]#

variables Get the variable dictionary.

Returns:

Copy of variables dictionary.

Return type:

Dict[str, Variable]

property schema: pydasa.dimensional.vaschy.Schema | None#

schema Get the dimensional framework schema.

Returns:

Schema instance or None.

Return type:

Optional[Schema]

property coefficients: Dict[str, pydasa.dimensional.buckingham.Coefficient]#

coefficients Get the coefficient dictionary.

Returns:

Copy of coefficients dictionary.

Return type:

Dict[str, Coefficient]

property results: Dict[str, Dict[str, Any]]#

results Get the result dictionary in the workflow.

Returns:

Copy of results dictionary.

Return type:

Dict[str, Dict[str, Any]]

property is_solved: bool#

is_solved Check if the workflow is finished.

Returns:

True if solved, False otherwise.

Return type:

bool

reset()#

reset Reset the workflow state while preserving input configuration. Clears coefficients, results, and solved state.

Return type:

None

clear()#

clear() Clear all workflow attributes, including variables, coefficients, results, and solved state.

Return type:

None

to_dict()#

to_dict() Convert the workflow instance to a dictionary representation, handling nested Schema, Variable, and Coefficient objects.

Returns:

Dictionary representation of the workflow.

Return type:

Dict[str, Any]

classmethod from_dict(data)#

from_dict() Create workflow instance from dictionary representation, converting dicts back to Variable, Coefficient, and Schema objects as needed.

Parameters:

data (Dict[str, Any]) – Dictionary representation of the workflow.

Returns:

Workflow instance created from the dictionary.

Return type:

WorkflowBase