hydroflows.methods.events.Forcing#

class hydroflows.methods.events.Forcing(*, type: Literal['water_level', 'discharge', 'rainfall'], path: Annotated[Path, PathType(path_type=file)], tstart: datetime | None = None, tstop: datetime | None = None, scale_mult: float | None = None, scale_add: float | None = None, locs_path: Annotated[Path, PathType(path_type=file)] | None = None, locs_id_col: str | None = None)[source]#

Bases: BaseModel

A forcing for the event.

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

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

field type: Literal['water_level', 'discharge', 'rainfall'] [Required]#

The type of the forcing.

field path: Annotated[Path, PathType(path_type=file)] [Required]#

The path to the forcing data.

field tstart: datetime | None = None#

The start date of the forcing data

field tstop: datetime | None = None#

The end date of the forcing data

field scale_mult: float | None = None#

A multiplicative scale factor for the forcing.

field scale_add: float | None = None#

An additive scale factor for the forcing.

field locs_path: Annotated[Path, PathType(path_type=file)] | None = None#

The path to the locations file for the forcing data.

field locs_id_col: str | None = None#

The column in the locations file with the location ID.

read_data() Any[source]#

Read the data.

property data: DataFrame#

Return the forcing data.

property locs: GeoDataFrame | None#

Return the locations data.

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.