reVeal.config.downscale.DownscaleConfig#
- class DownscaleConfig(*, 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: ProjectionResolutionEnum, 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:
BaseDownscaleConfigWrapper class for downscaling configuration. Based on the the projection resolution of the inputs, instantiates either a TotalDownScaleConfig or RegionalDownscaleConfig.
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
Dynamically set the crs property.
Dynamically set the grid_ext property.
Dynamically set the dset_flavor.
Validate the input grid dataset can be opened, has the expected attributes, and those attributes are numeric.
Validate the input load_projections dataset can be opened, has the expected attributes, and those attributes are numeric.
Attributes
model_computed_fieldsConfiguration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Get extra fields set during validation.
model_fieldsReturns the set of fields that have been explicitly set on this model instance.
grid_prioritygrid_baseline_loadbaseline_yeargrid_capacityprojection_resolutionload_projectionsload_valueload_yearmax_site_addition_per_yearsite_saturation_limitpriority_powern_bootstrapsrandom_seedmax_workersreduce_outputgridgrid_extgrid_flavorgrid_crs- 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.