hydroflows.workflow.Parameters#

class hydroflows.workflow.Parameters[source]#

Bases: BaseModel

Parameters class.

This class is used to define the parameters (input, output and params) for a method.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_dict(mode: Literal['python', 'json'] = 'python', filter_types: Tuple[Type] = None, filter_keys: List = None, return_refs=False, posix_path=False, quote_str=False, exclude_ref_keys: List[str] = None, **kwargs) Dict[source]#

Convert the parameters fields to a dictionary.

Parameters:
  • mode (Literal["python", "json"], optional) – The serialization mode, by default “python”

  • filter_types (Tuple[Type], optional) – Filter the parameters by type, by default None

  • filter_keys (List, optional) – Filter the parameters by key, by default None

  • return_refs (bool, optional) – Return references instead of values, by default False

  • posix_path (bool, optional) – Convert Path objects to posix paths (str), by default False

  • quote_str (bool, optional) – Quote string values, by default False

  • exclude_ref_keys (List[str], optional) – Do not transform these keys to references, by default None

property all_fields#

Model and extra field names.

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.