zen_garden.default_config

Set default configurations in ZEN_garden.

This module defines default values for all configurations in ZEN_garden. The class Config serves as a container grouping all model configurations. The configurations are further organized in a class structure that resembles that of the ZEN-garden input data. The Config class thus links to the four main configuration types (analysis, solver, system, and scenario), each defined using separate class. Default configurations for the system.json configurations are located in the class System. Whenever a configuration consists of a dictionary, a new class is defined to provide a template for the configuration and define all required default values.

The current structure of classes in which defaults are set is as follows:

Config
|--Analysis
|  |--Subsets
|  |--HeaderDataInputs
|  `--TimeSeriesAggregation
|
|--Solver
|--System
`--Scenario

Default values are overwritten by any changes specified in the input files system.json, scenarios.json, and config.json.

class zen_garden.default_config.Analysis(*, dataset: str = '', objective: Literal['total_cost', 'total_carbon_emissions'] = 'total_cost', sense: str = 'min', subsets: Subsets = Subsets(set_carriers=[], set_technologies={'set_conversion_technologies': ['set_retrofitting_technologies'], 'set_transport_technologies': [], 'set_storage_technologies': []}), header_data_inputs: HeaderDataInputs = HeaderDataInputs(set_nodes='node', set_edges='edge', set_location='location', set_time_steps='time', set_time_steps_operation='time_operation', set_time_steps_storage_level='time_storage_level', set_time_steps_yearly='year', set_time_steps_yearly_entire_horizon='year_entire_horizon', set_carriers='carrier', set_input_carriers='carrier', set_output_carriers='carrier', set_time_steps_storage='time_storage_level', set_dependent_carriers='carrier', set_elements='element', set_conversion_technologies='technology', set_transport_technologies='technology', set_transport_technologies_loss_exponential='technology', set_storage_technologies='technology', set_technologies='technology', set_technologies_existing='technology_existing', set_capacity_types='capacity_type'), time_series_aggregation: TimeSeriesAggregation = TimeSeriesAggregation(clusterMethod='hierarchical', solver='highs', hoursPerPeriod=1, extremePeriodMethod='None', rescaleClusterPeriods=False, representationMethod='meanRepresentation', resolution=1), folder_output: str = './outputs/', overwrite_output: bool = True, output_format: str = 'h5', earliest_year_of_data: int = 1900, zen_garden_version: str = None, **extra_data: Any)

Class which contains the analysis configuration.

This defines for example the objective function, output settings, etc.

class zen_garden.default_config.Config(*, analysis: Analysis = Analysis(dataset='', objective='total_cost', sense='min', subsets=Subsets(set_carriers=[], set_technologies={'set_conversion_technologies': ['set_retrofitting_technologies'], 'set_transport_technologies': [], 'set_storage_technologies': []}), header_data_inputs=HeaderDataInputs(set_nodes='node', set_edges='edge', set_location='location', set_time_steps='time', set_time_steps_operation='time_operation', set_time_steps_storage_level='time_storage_level', set_time_steps_yearly='year', set_time_steps_yearly_entire_horizon='year_entire_horizon', set_carriers='carrier', set_input_carriers='carrier', set_output_carriers='carrier', set_time_steps_storage='time_storage_level', set_dependent_carriers='carrier', set_elements='element', set_conversion_technologies='technology', set_transport_technologies='technology', set_transport_technologies_loss_exponential='technology', set_storage_technologies='technology', set_technologies='technology', set_technologies_existing='technology_existing', set_capacity_types='capacity_type'), time_series_aggregation=TimeSeriesAggregation(clusterMethod='hierarchical', solver='highs', hoursPerPeriod=1, extremePeriodMethod='None', rescaleClusterPeriods=False, representationMethod='meanRepresentation', resolution=1), folder_output='./outputs/', overwrite_output=True, output_format='h5', earliest_year_of_data=1900, zen_garden_version=None), solver: Solver = Solver(name='highs', solver_options={}, check_unit_consistency=True, solver_dir='.//outputs//solver_files', keep_files=False, io_api='lp', save_duals=False, save_reduced_costs=False, save_parameters=True, selected_saved_parameters=[], selected_saved_variables=[], selected_saved_duals=[], selected_saved_reduced_costs=[], linear_regression_check={'eps_intercept': 0.1, 'epsRvalue': 0.99999}, round_parameters=False, rounding_decimal_points_units=6, rounding_decimal_points_capacity=4, rounding_decimal_points_tsa=4, analyze_numerics=True, run_diagnostics=False, use_scaling=True, scaling_include_rhs=True, scaling_algorithm=['geom', 'geom', 'geom']), system: System = System(set_carriers=[], set_capacity_types=['power', 'energy'], set_technologies=[], set_conversion_technologies=[], set_storage_technologies=[], set_retrofitting_technologies=[], storage_periodicity=True, multiyear_periodicity=False, set_transport_technologies=[], set_transport_technologies_loss_exponential=[], double_capex_transport=False, set_nodes=[], coords={}, exclude_parameters_from_TSA=True, conduct_scenario_analysis=False, run_default_scenario=True, clean_sub_scenarios=False, total_hours_per_year=8760, knowledge_depreciation_rate=0.1, reference_year=2024, unaggregated_time_steps_per_year=8760, aggregated_time_steps_per_year=8760, conduct_time_series_aggregation=False, optimized_years=1, interval_between_years=1, use_rolling_horizon=False, years_in_rolling_horizon=1, years_in_decision_horizon=1, use_capacities_existing=True, allow_investment=True, storage_charge_discharge_binary=False), plugins: dict[str, Any] = {}, scenarios: dict[str, Any] = {'': {}}, **extra_data: Any)

Class which contains the configuration of the model.

This includes the configurations of the system, solver, and analysis as well as the dictionary of scenarios.

class zen_garden.default_config.HeaderDataInputs(*, set_nodes: str = 'node', set_edges: str = 'edge', set_location: str = 'location', set_time_steps: str = 'time', set_time_steps_operation: str = 'time_operation', set_time_steps_storage_level: str = 'time_storage_level', set_time_steps_yearly: str = 'year', set_time_steps_yearly_entire_horizon: str = 'year_entire_horizon', set_carriers: str = 'carrier', set_input_carriers: str = 'carrier', set_output_carriers: str = 'carrier', set_time_steps_storage: str = 'time_storage_level', set_dependent_carriers: str = 'carrier', set_elements: str = 'element', set_conversion_technologies: str = 'technology', set_transport_technologies: str = 'technology', set_transport_technologies_loss_exponential: str = 'technology', set_storage_technologies: str = 'technology', set_technologies: str = 'technology', set_technologies_existing: str = 'technology_existing', set_capacity_types: str = 'capacity_type', **extra_data: Any)

Maps input/output headers to internal set names used in ZEN-garden.

This class defines standard header names for the input and output files of ZEN-garden. It provides a mapping between the column headers of input/output files and internal set names used in the code. For example, the class attribute “set_nodes” (default value “node”) means that any input csv file with column header “node” will be interpreted as containing elements of the internal set “set_nodes”.

Inherits from:

Subscriptable - Provides dictionary-like access to attributes and allows input data handling via Pydantic’s BaseModel

class zen_garden.default_config.Solver(*, name: str = 'highs', solver_options: dict = {}, check_unit_consistency: bool = True, solver_dir: str = './/outputs//solver_files', keep_files: bool = False, io_api: str = 'lp', save_duals: bool = False, save_reduced_costs: bool = False, save_parameters: bool = True, selected_saved_parameters: list = [], selected_saved_variables: list = [], selected_saved_duals: list = [], selected_saved_reduced_costs: list = [], linear_regression_check: dict[str, float] = {'epsRvalue': 0.99999, 'eps_intercept': 0.1}, round_parameters: bool = False, rounding_decimal_points_units: int = 6, rounding_decimal_points_capacity: int = 4, rounding_decimal_points_tsa: int = 4, analyze_numerics: bool = True, run_diagnostics: bool = False, use_scaling: bool = True, scaling_include_rhs: bool = True, scaling_algorithm: list[str] | str = ['geom', 'geom', 'geom'], **extra_data: Any)

Class which contains the solver configuration.

This defines for example the solver options, scaling, etc.

class zen_garden.default_config.Subscriptable(**extra_data: Any)

Allows dictionary-like access to class attributes.

This class allows dictionary-like access to class attributes, such as obj["key"] instead of obj.key. Similarly, attribute values can be changed in a dictionary like fashion obj["key"] = new_value. Lastly, attribute names and values can be called using the methods .keys(), .values(), and .items() like in a normal dictionary.

Inherits from:

BaseModel - Class from the Pydantic package which provides advanced features in input data handling and validation.

class zen_garden.default_config.Subsets(*, set_carriers: list[str] = [], set_technologies: dict[str, list[str]] | list[str] = {'set_conversion_technologies': ['set_retrofitting_technologies'], 'set_storage_technologies': [], 'set_transport_technologies': []}, **extra_data: Any)
class zen_garden.default_config.System(*, set_carriers: list[str] = [], set_capacity_types: list[str] = ['power', 'energy'], set_technologies: list[str] = [], set_conversion_technologies: list[str] = [], set_storage_technologies: list[str] = [], set_retrofitting_technologies: list[str] = [], storage_periodicity: bool = True, multiyear_periodicity: bool = False, set_transport_technologies: list[str] = [], set_transport_technologies_loss_exponential: list[str] = [], double_capex_transport: bool = False, set_nodes: list[str] = [], coords: dict[str, dict[str, float]] = {}, exclude_parameters_from_TSA: bool = True, conduct_scenario_analysis: bool = False, run_default_scenario: bool = True, clean_sub_scenarios: bool = False, total_hours_per_year: int = 8760, knowledge_depreciation_rate: float = 0.1, reference_year: int = 2024, unaggregated_time_steps_per_year: int = 8760, aggregated_time_steps_per_year: int = 8760, conduct_time_series_aggregation: bool = False, optimized_years: int = 1, interval_between_years: int = 1, use_rolling_horizon: bool = False, years_in_rolling_horizon: int = 1, years_in_decision_horizon: int = 1, use_capacities_existing: bool = True, allow_investment: bool = True, storage_charge_discharge_binary: bool = False, **extra_data: Any)

Class which contains the system configuration.

This defines for example the set of carriers, technologies, etc.

class zen_garden.default_config.TimeSeriesAggregation(*, clusterMethod: str = 'hierarchical', solver: str = 'highs', hoursPerPeriod: int = 1, extremePeriodMethod: str | None = 'None', rescaleClusterPeriods: bool = False, representationMethod: str = 'meanRepresentation', resolution: int = 1, **extra_data: Any)

Class which contains the time series aggregation configuration.

This defines for example the clustering method, etc.