zen-garden 2.8.11__tar.gz → 2.8.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {zen_garden-2.8.11 → zen_garden-2.8.13}/PKG-INFO +6 -3
- {zen_garden-2.8.11 → zen_garden-2.8.13}/README.md +2 -2
- {zen_garden-2.8.11 → zen_garden-2.8.13}/pyproject.toml +30 -6
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/postprocess/results/solution_loader.py +3 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/preprocess/time_series_aggregation.py +46 -34
- {zen_garden-2.8.11 → zen_garden-2.8.13}/LICENSE.txt +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/__init__.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/__main__.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/cli/__init__.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/cli/zen_example_cli.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/cli/zen_garden_cli.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/cli/zen_visualization_cli.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/default_config.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/__init__.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/carrier/__init__.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/carrier/carrier.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/component.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/element.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/energy_system.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/technology/__init__.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/technology/conversion_technology.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/technology/retrofitting_technology.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/technology/storage_technology.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/technology/technology.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/technology/transport_technology.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/time_steps.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/optimization_setup.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/postprocess/.gitkeep +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/postprocess/__init__.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/postprocess/comparisons.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/postprocess/postprocess.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/postprocess/results/__init__.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/postprocess/results/cache.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/postprocess/results/results.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/preprocess/__init__.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/preprocess/extract_input_data.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/preprocess/parameter_change_log.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/preprocess/unit_handling.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/runner.py +0 -0
- {zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zen_garden
|
|
3
|
-
Version: 2.8.
|
|
3
|
+
Version: 2.8.13
|
|
4
4
|
Summary: ZEN-garden is an optimization model of energy systems and value chains.
|
|
5
5
|
Author: Alissa Ganter, Johannes Burger, Francesco De Marco, Lukas Kunz, Lukas Schmidt-Engelbertz, Christoph Funke, Paolo Gabrielli, Giovanni Sansavini
|
|
6
6
|
Author-email: Jacob Mannhardt <zen-garden@ethz.ch>
|
|
@@ -29,6 +29,9 @@ Requires-Dist: pytest ; extra == "dev"
|
|
|
29
29
|
Requires-Dist: coverage ; extra == "dev"
|
|
30
30
|
Requires-Dist: pytest-xdist ; extra == "dev"
|
|
31
31
|
Requires-Dist: pytest-cov ; extra == "dev"
|
|
32
|
+
Requires-Dist: black==25.12.0 ; extra == "dev"
|
|
33
|
+
Requires-Dist: ruff==0.14.13 ; extra == "dev"
|
|
34
|
+
Requires-Dist: mypy==1.19.1 ; extra == "dev"
|
|
32
35
|
Requires-Dist: sphinx==7.3.7 ; extra == "docs"
|
|
33
36
|
Requires-Dist: myst-parser==3.0.1 ; extra == "docs"
|
|
34
37
|
Requires-Dist: sphinx-book-theme==1.1.3 ; extra == "docs"
|
|
@@ -72,13 +75,13 @@ ZEN-garden is developed by the [Reliability and Risk Engineering Laboratory](htt
|
|
|
72
75
|
<hr style="height: 5px; background-color: black;">
|
|
73
76
|
|
|
74
77
|
## Quick Start
|
|
75
|
-
To get started with ZEN-garden, you can follow the instructions in the [installation guide](https://zen-garden.readthedocs.io/en/latest/files/
|
|
78
|
+
To get started with ZEN-garden, you can follow the instructions in the [installation guide](https://zen-garden.readthedocs.io/en/latest/files/quick_start/installation.html).
|
|
76
79
|
|
|
77
80
|
If you want to use ZEN-garden without working on the codebase, run the following command:
|
|
78
81
|
```bash
|
|
79
82
|
pip install zen-garden
|
|
80
83
|
```
|
|
81
|
-
If you want to work on the codebase, fork and clone the repository and install the package in editable mode. More information on how to install the package in editable mode can be found in the [installation guide](https://zen-garden.readthedocs.io/en/latest/files/
|
|
84
|
+
If you want to work on the codebase, fork and clone the repository and install the package in editable mode. More information on how to install the package in editable mode can be found in the [installation guide](https://zen-garden.readthedocs.io/en/latest/files/quick_start/installation.html).
|
|
82
85
|
|
|
83
86
|
## Documentation
|
|
84
87
|
Please refer to the documentation of the ZEN-garden framework [on Read-the-Docs](https://zen-garden.readthedocs.io/en/latest/).
|
|
@@ -22,13 +22,13 @@ ZEN-garden is developed by the [Reliability and Risk Engineering Laboratory](htt
|
|
|
22
22
|
<hr style="height: 5px; background-color: black;">
|
|
23
23
|
|
|
24
24
|
## Quick Start
|
|
25
|
-
To get started with ZEN-garden, you can follow the instructions in the [installation guide](https://zen-garden.readthedocs.io/en/latest/files/
|
|
25
|
+
To get started with ZEN-garden, you can follow the instructions in the [installation guide](https://zen-garden.readthedocs.io/en/latest/files/quick_start/installation.html).
|
|
26
26
|
|
|
27
27
|
If you want to use ZEN-garden without working on the codebase, run the following command:
|
|
28
28
|
```bash
|
|
29
29
|
pip install zen-garden
|
|
30
30
|
```
|
|
31
|
-
If you want to work on the codebase, fork and clone the repository and install the package in editable mode. More information on how to install the package in editable mode can be found in the [installation guide](https://zen-garden.readthedocs.io/en/latest/files/
|
|
31
|
+
If you want to work on the codebase, fork and clone the repository and install the package in editable mode. More information on how to install the package in editable mode can be found in the [installation guide](https://zen-garden.readthedocs.io/en/latest/files/quick_start/installation.html).
|
|
32
32
|
|
|
33
33
|
## Documentation
|
|
34
34
|
Please refer to the documentation of the ZEN-garden framework [on Read-the-Docs](https://zen-garden.readthedocs.io/en/latest/).
|
|
@@ -16,7 +16,7 @@ authors = [
|
|
|
16
16
|
{name = "Giovanni Sansavini"},
|
|
17
17
|
]
|
|
18
18
|
# do not change version manually! Done by bump2version
|
|
19
|
-
version = "2.8.
|
|
19
|
+
version = "2.8.13"
|
|
20
20
|
requires-python= ">=3.11,<3.14"
|
|
21
21
|
description="ZEN-garden is an optimization model of energy systems and value chains."
|
|
22
22
|
readme = "README.md"
|
|
@@ -60,7 +60,10 @@ dev = [
|
|
|
60
60
|
"pytest",
|
|
61
61
|
"coverage",
|
|
62
62
|
"pytest-xdist",
|
|
63
|
-
"pytest-cov"
|
|
63
|
+
"pytest-cov",
|
|
64
|
+
"black==25.12.0",
|
|
65
|
+
"ruff==0.14.13",
|
|
66
|
+
"mypy==1.19.1"
|
|
64
67
|
]
|
|
65
68
|
|
|
66
69
|
vis = [
|
|
@@ -74,10 +77,31 @@ Homepage = "https://github.com/ZEN-universe/ZEN-garden"
|
|
|
74
77
|
Documentation = "https://zen-garden.readthedocs.io/en/latest/"
|
|
75
78
|
Zenodo = "https://zenodo.org/api/records/13385110"
|
|
76
79
|
|
|
77
|
-
[tool.pytest.ini_options]
|
|
78
|
-
addopts = "-n auto"
|
|
79
|
-
|
|
80
80
|
[project.scripts]
|
|
81
81
|
zen-garden = "zen_garden.cli.zen_garden_cli:create_zen_garden_cli"
|
|
82
82
|
zen-visualization = "zen_garden.cli.zen_visualization_cli:create_zen_visualization_cli"
|
|
83
|
-
zen-example = "zen_garden.cli.zen_example_cli:create_zen_example_cli"
|
|
83
|
+
zen-example = "zen_garden.cli.zen_example_cli:create_zen_example_cli"
|
|
84
|
+
|
|
85
|
+
[tool.pytest.ini_options]
|
|
86
|
+
addopts = "-n auto"
|
|
87
|
+
|
|
88
|
+
[tool.black]
|
|
89
|
+
line-length = 79
|
|
90
|
+
target-version = ["py311", "py312", "py313"]
|
|
91
|
+
|
|
92
|
+
[tool.ruff]
|
|
93
|
+
line-length = 79
|
|
94
|
+
fix = false
|
|
95
|
+
|
|
96
|
+
[tool.ruff.lint]
|
|
97
|
+
select = ["E", "F", "I", "B"]
|
|
98
|
+
ignore = []
|
|
99
|
+
|
|
100
|
+
[tool.ruff.lint.isort]
|
|
101
|
+
known-first-party = ["your_package_name"]
|
|
102
|
+
|
|
103
|
+
[tool.mypy]
|
|
104
|
+
warn_unused_configs = true
|
|
105
|
+
ignore_missing_imports = true
|
|
106
|
+
check_untyped_defs = false
|
|
107
|
+
disallow_untyped_defs = false
|
|
@@ -305,7 +305,7 @@ class TimeSeriesAggregation(object):
|
|
|
305
305
|
else:
|
|
306
306
|
for element in self.optimization_setup.get_all_elements(Element):
|
|
307
307
|
# check to multiply the time series with the yearly variation
|
|
308
|
-
self.
|
|
308
|
+
self.overwrite_ts_without_expanded_timeindex(element)
|
|
309
309
|
|
|
310
310
|
def overwrite_ts_with_expanded_timeindex(self, element, old_sequence_time_steps):
|
|
311
311
|
""" this method expands the aggregated time series to match the extended operational time steps because of matching the investment and operational time sequences.
|
|
@@ -323,46 +323,24 @@ class TimeSeriesAggregation(object):
|
|
|
323
323
|
new_ts = new_ts.stack()
|
|
324
324
|
# multiply with yearly variation
|
|
325
325
|
new_ts = self.multiply_yearly_variation(element, ts, new_ts)
|
|
326
|
-
#insert year specific TSA output
|
|
327
|
-
|
|
328
|
-
for year in self.year_specific_tsa.keys():
|
|
329
|
-
if (element.name,ts) in self.year_specific_tsa[year].keys():
|
|
330
|
-
base_time_steps = self.energy_system.time_steps.decode_time_step(year, "yearly")
|
|
331
|
-
element_time_steps = self.energy_system.time_steps.encode_time_step(base_time_steps,time_step_type="operation")
|
|
332
|
-
year_ts = self.year_specific_tsa[year][element.name,ts]
|
|
333
|
-
#ToDO better assignment of values?
|
|
334
|
-
for column in year_ts.columns:
|
|
335
|
-
if isinstance(column, tuple):
|
|
336
|
-
new_ts.loc[*column, element_time_steps] = year_ts[column].values
|
|
337
|
-
else:
|
|
338
|
-
new_ts.loc[column,element_time_steps] = year_ts[column].values
|
|
339
|
-
#insert year specific TS if not aggregated
|
|
340
|
-
else:
|
|
341
|
-
for year in self.optimization_setup.year_specific_ts.keys():
|
|
342
|
-
if (element.name,ts) in self.optimization_setup.year_specific_ts[year].keys():
|
|
343
|
-
base_time_steps = self.energy_system.time_steps.decode_time_step(year, "yearly")
|
|
344
|
-
element_time_steps = self.energy_system.time_steps.encode_time_step(base_time_steps,time_step_type="operation")
|
|
345
|
-
year_ts = self.optimization_setup.year_specific_ts[year][(element.name,ts)].unstack(header_set_time_steps).T
|
|
346
|
-
#ToDO better assignment of values?
|
|
347
|
-
for column in year_ts.columns:
|
|
348
|
-
if isinstance(column, tuple):
|
|
349
|
-
new_ts.loc[*column, element_time_steps] = year_ts[column].values
|
|
350
|
-
else:
|
|
351
|
-
new_ts.loc[column, element_time_steps] = year_ts[column].values
|
|
326
|
+
# insert year specific TSA output
|
|
327
|
+
new_ts = self.add_year_specific_ts(element, ts,new_ts,header_set_time_steps)
|
|
352
328
|
#overwrite time series
|
|
353
329
|
setattr(element, ts, new_ts)
|
|
354
330
|
|
|
355
|
-
def
|
|
331
|
+
def overwrite_ts_without_expanded_timeindex(self, element):
|
|
356
332
|
""" multiply the time series with the yearly variation if the element's time series are not aggregated
|
|
357
333
|
|
|
358
334
|
:param element: element of the optimization """
|
|
335
|
+
header_set_time_steps = self.analysis.header_data_inputs.set_time_steps
|
|
359
336
|
for ts in element.raw_time_series:
|
|
360
|
-
if element.raw_time_series[ts] is None:
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
337
|
+
if element.raw_time_series[ts] is not None:
|
|
338
|
+
# multiply with yearly variation
|
|
339
|
+
new_ts = self.multiply_yearly_variation(element, ts, getattr(element, ts))
|
|
340
|
+
# insert year specific TSA output
|
|
341
|
+
new_ts = self.add_year_specific_ts(element, ts,new_ts,header_set_time_steps)
|
|
342
|
+
# overwrite time series
|
|
343
|
+
setattr(element, ts, new_ts)
|
|
366
344
|
|
|
367
345
|
def multiply_yearly_variation(self, element, ts_name, ts, year_specific = None):
|
|
368
346
|
""" this method multiplies time series with the yearly variation of the time series
|
|
@@ -398,7 +376,41 @@ class TimeSeriesAggregation(object):
|
|
|
398
376
|
rounding_value = 10 ** (-self.optimization_setup.solver.rounding_decimal_points_tsa)
|
|
399
377
|
ts[ts.abs() < rounding_value] = 0
|
|
400
378
|
return ts
|
|
379
|
+
|
|
380
|
+
def add_year_specific_ts(self, element, ts,new_ts,header_set_time_steps):
|
|
381
|
+
""" this method adds a year specific time series for an element
|
|
401
382
|
|
|
383
|
+
:param element: element of the time series
|
|
384
|
+
:param ts: time series to add
|
|
385
|
+
:param new_ts: new time series to add year specific values to
|
|
386
|
+
:param header_set_time_steps: name of set_time_steps """
|
|
387
|
+
if self.conducted_tsa:
|
|
388
|
+
for year in self.year_specific_tsa.keys():
|
|
389
|
+
if (element.name,ts) in self.year_specific_tsa[year].keys():
|
|
390
|
+
base_time_steps = self.energy_system.time_steps.decode_time_step(year, "yearly")
|
|
391
|
+
element_time_steps = self.energy_system.time_steps.encode_time_step(base_time_steps,time_step_type="operation")
|
|
392
|
+
year_ts = self.year_specific_tsa[year][element.name,ts]
|
|
393
|
+
#ToDO better assignment of values?
|
|
394
|
+
for column in year_ts.columns:
|
|
395
|
+
if isinstance(column, tuple):
|
|
396
|
+
new_ts.loc[*column, element_time_steps] = year_ts[column].values
|
|
397
|
+
else:
|
|
398
|
+
new_ts.loc[column,element_time_steps] = year_ts[column].values
|
|
399
|
+
#insert year specific TS if not aggregated
|
|
400
|
+
else:
|
|
401
|
+
for year in self.optimization_setup.year_specific_ts.keys():
|
|
402
|
+
if (element.name,ts) in self.optimization_setup.year_specific_ts[year].keys():
|
|
403
|
+
base_time_steps = self.energy_system.time_steps.decode_time_step(year, "yearly")
|
|
404
|
+
element_time_steps = self.energy_system.time_steps.encode_time_step(base_time_steps,time_step_type="operation")
|
|
405
|
+
year_ts = self.optimization_setup.year_specific_ts[year][(element.name,ts)].unstack(header_set_time_steps).T
|
|
406
|
+
#ToDO better assignment of values?
|
|
407
|
+
for column in year_ts.columns:
|
|
408
|
+
if isinstance(column, tuple):
|
|
409
|
+
new_ts.loc[*column, element_time_steps] = year_ts[column].values
|
|
410
|
+
else:
|
|
411
|
+
new_ts.loc[column, element_time_steps] = year_ts[column].values
|
|
412
|
+
return new_ts
|
|
413
|
+
|
|
402
414
|
def repeat_sequence_time_steps_for_all_years(self):
|
|
403
415
|
""" this method repeats the operational time series for all years."""
|
|
404
416
|
logging.info("Repeat the time series sequences for all years")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/technology/conversion_technology.py
RENAMED
|
File without changes
|
{zen_garden-2.8.11 → zen_garden-2.8.13}/zen_garden/model/technology/retrofitting_technology.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|