spaemis.config
Configuration
The configuration is stored as YAML files and can be loaded and validated using
load_config().
ExcludeScaleMethod
ConstantScaleMethod
RelativeChangeMethod
ProxyMethod
TimeseriesMethod
PointSourceMethod
VariableScalerConfig
- class VariableScalerConfig(variable, sector, method, allow_missing=False)[source]
Bases:
objectRepresents a mapping between a variable/sector and a scaler
In some cases, the target data may not exist in an inventory. In that case the scaler should be configured correctly to be able to handle that situation.
- variable
Name of the target variable in the inventory
- sector
Name of the target sector in the inventory
- allow_missing
If True, the data may not be present in an inventory
InputTimeseries
PointSource
PointSourceDefinition
ScalerDefinition
Inventory
DownscalingScenarioConfig
load_config
- load_config(config_file)[source]
Load and parse configuration from a file
Any filenames referenced in the configuration are relative to the configuration file not the current directory.
- Parameters:
config_file (
str) – File to read- Returns:
spaemis.config.DownscalingScenarioConfig– Validated configuration
get_path
get_default_results_dir
- get_default_results_dir(config_path)[source]
Get the default output path for a given configuration file
Defaults to
data/runs/{OUTPUT_VERSION}/{CONFIG_FILE_NAME}. This function does not create that directory if it doesn’t already exist.- Parameters:
config_path (
str) –- Raises:
FileNotFoundError – If config_path doesn’t exist
- Returns:
str– Output directory for results