rubem.configuration.model_configuration_file_v1.ModelConfigurationFileV1
- class ModelConfigurationFileV1(**data)[source]
-
Bases:
_StrictThe configuration file, format 1.0.
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
Read a 1.0 file.
Build a 1.0 configuration equivalent to a legacy one.
Resolve a
from/tovalue, following the period references.Return a copy whose relative paths are anchored on
base_dir.The JSON document (ISO dates,
$refobjects kept).Build the legacy equivalent, when every series is a directory series.
Attributes
versionmetadatasimulation_periodraster_seriesrasterslookup_tablesraster_info- classmethod from_json(path)[source]
-
Read a 1.0 file. Duplicated keys are an error in this format.
- Raises:
-
ValueError – On duplicated keys.
- Return type:
-
Self
- classmethod from_legacy(legacy, metadata=None)[source]
-
Build a 1.0 configuration equivalent to a legacy one.
Directory series become
dir_path/files_prefixentries, the period keeps its dates, the legacy time-series flag becomes thetime_series_samplesselection (CSV only, as the legacy run writes), and the raster formats followRASTER_FILE_FORMAT.- Return type:
-
Self
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}
-
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- resolve_date(value)[source]
-
Resolve a
from/tovalue, following the period references.- Return type:
-
date
- resolve_paths(base_dir)[source]
-
Return a copy whose relative paths are anchored on
base_dir.- Return type:
-
Self
- to_legacy()[source]
-
Build the legacy equivalent, when every series is a directory series.
- Raises:
-
ValueError – If a series is not given as a directory with a prefix, or the outputs use a combination the legacy file cannot express (time series without their raster series, formats other than CSV for the tables).
- Return type: