reVeal.config.downscale.TotalDownscaleConfig#

class TotalDownscaleConfig(*, grid: Annotated[Path, PathType(path_type=file)], grid_ext: str | None = None, grid_flavor: str | None = None, grid_crs: str | None = None, grid_priority: str, grid_baseline_load: str, baseline_year: Annotated[int, Gt(gt=0)], grid_capacity: str, projection_resolution: TotalResolutionEnum, load_projections: Annotated[Path, PathType(path_type=file)], load_value: str, load_year: str, max_site_addition_per_year: Annotated[float | None, Strict(strict=False), Gt(gt=0.0)] = None, site_saturation_limit: Annotated[float | None, Strict(strict=False), Gt(gt=0.0), Le(le=1.0)] = 1.0, priority_power: Annotated[float | None, Strict(strict=False), Gt(gt=0.0)] = 1.0, n_bootstraps: Annotated[int, Gt(gt=0)] | None = 10000, random_seed: int | None = 0, max_workers: Annotated[int, Gt(gt=0)] | None = None, reduce_output: bool | None = False, **extra_data: Any)[source]#

Bases: BaseDownscaleConfig

Model for total downscaling configuration. Extends BaseDownscaleConfig with additional validations.

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.

Methods

set_grid_crs()

Dynamically set the crs property.

set_grid_ext()

Dynamically set the grid_ext property.

set_grid_flavor()

Dynamically set the dset_flavor.

validate_grid()

Validate the input grid dataset can be opened, has the expected attributes, and those attributes are numeric.

validate_load_projections()

Validate the input load_projections dataset can be opened, has the expected attributes, and those attributes are numeric.

validate_load_projections_duplicates()

Validate the input load_projections dataset can be opened, has the expected attributes, and those attributes are numeric.

Attributes

model_computed_fields

model_config

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

model_extra

Get extra fields set during validation.

model_fields

model_fields_set

Returns the set of fields that have been explicitly set on this model instance.

projection_resolution

grid_priority

grid_baseline_load

baseline_year

grid_capacity

load_projections

load_value

load_year

max_site_addition_per_year

site_saturation_limit

priority_power

n_bootstraps

random_seed

max_workers

reduce_output

grid

grid_ext

grid_flavor

grid_crs

validate_load_projections_duplicates()[source]#

Validate the input load_projections dataset can be opened, has the expected attributes, and those attributes are numeric. Also ensures that the projections are for years after the the specified baseline year.

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

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

property model_extra: dict[str, Any] | None#

Get extra fields set during validation.

Returns:

A dictionary of extra fields, or None if config.extra is not set to “allow”.

property model_fields_set: set[str]#

Returns the set of fields that have been explicitly set on this model instance.

Returns:
A set of strings representing the fields that have been set,

i.e. that were not filled from defaults.

set_grid_crs()#

Dynamically set the crs property.

set_grid_ext()#

Dynamically set the grid_ext property.

set_grid_flavor()#

Dynamically set the dset_flavor.

Raises:

TypeError – A TypeError will be raised if the input dset is not either a geoparquet or compatible with reading with ogr.

validate_grid()#

Validate the input grid dataset can be opened, has the expected attributes, and those attributes are numeric.

validate_load_projections()#

Validate the input load_projections dataset can be opened, has the expected attributes, and those attributes are numeric. Also ensures that the projections are for years after the the specified baseline year.