hydroflows.methods.flood_adapt.setup_flood_adapt#

Prepare FloodAdapt database builder.

class hydroflows.methods.flood_adapt.setup_flood_adapt.SetupFloodAdapt(sfincs_inp: Path | None = None, fiat_cfg: Path | None = None, event_set_yaml: Path | None = None, output_dir: Path = 'flood_adapt_builder', db_name: str = 'fa_database', description: str = 'This is a FloodAdapt Database')[source]#

Method for setting up the input for the FloodAdapt Database Builder.

Parameters:
  • sfincs_inp (Path) – The file path to the SFINCS base model.

  • fiat_cfg (Path) – The file path to the FIAT base model.

  • event_set_yaml (Path, optional) – The file path to the HydroFlows event set yaml file.

  • output_dir (Path, optional) – The folder where the output is stored, by default “flood_adapt_builder”.

  • db_name (str, optional) – The name of the FloodAdapt Database

  • description (str, optional) – The description of the FloodAdapt Database

  • **params – Additional parameters to pass to the GetERA5Rainfall instance.

pydantic model hydroflows.methods.flood_adapt.setup_flood_adapt.Input[source]#

Input parameters for the SetupFloodAdapt method.

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 event_set_yaml: Annotated[Path, AfterValidator(func=filedir_validator)] | None = None#

The file path to the event set YAML file.

field fiat_cfg: Annotated[Path, AfterValidator(func=filedir_validator)] | None = None#

The file path to the FIAT base model config file.

field sfincs_inp: Annotated[Path, AfterValidator(func=filedir_validator)] | None = None#

The file path to the SFINCS base model config 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.flood_adapt.setup_flood_adapt.Output[source]#

Output parameters for the SetupFloodAdapt method.

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 fa_build_toml: Path [Required]#

The file path to the flood adaptation model.

field fiat_out_cfg: Annotated[Path, AfterValidator(func=filedir_validator)] [Required]#

The path to the copied fiat model configuration.

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.flood_adapt.setup_flood_adapt.Params[source]#

Parameters for the SetupFloodAdapt method.

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 db_name: str = 'fa_database'#

The name of the FloodAdapt Database

field description: str = 'This is a FloodAdapt Database'#

The description of the FloodAdapt Database

field output_dir: Annotated[Path, AfterValidator(func=outputdirpath_validator)] = PosixPath('flood_adapt_builder')#

The directory where the output files will be saved.

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.