hydroflows.methods.script.script_method#

Method to run python script with HydroFlows.

class hydroflows.methods.script.script_method.ScriptMethod(script: Path, output: Dict[str, Path], input: Dict[str, Path] = None, params: Dict[str, Any] | None = None)[source]#

Method to run python script with HydroFlows.

Parameters:
  • script (Path) – Path to the script file.

  • output (Dict[str, Path]) – Output files.

  • input (Dict[str, Path]) – Input files.

  • params (Dict) – Parameters.

property json_kwargs#

Return input, params and output as json string.

to_kwargs(mode='json', exclude_defaults=True, posix_path=False, return_refs=False, **kwargs)[source]#

Convert the method to a dictionary of keyword arguments.

pydantic model hydroflows.methods.script.script_method.ScriptInput[source]#

Output parameters for ScriptMethod class.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field script: Path | None = None#

Path to the script file.

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.

pydantic model hydroflows.methods.script.script_method.ScriptOutput[source]#

Input parameters for ScriptMethod class.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

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.

pydantic model hydroflows.methods.script.script_method.ScriptParams[source]#

Parameters for ScriptMethod class.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

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.