zen-garden 2.8.11__tar.gz → 2.8.12__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.
Files changed (40) hide show
  1. {zen_garden-2.8.11 → zen_garden-2.8.12}/PKG-INFO +1 -1
  2. {zen_garden-2.8.11 → zen_garden-2.8.12}/pyproject.toml +1 -1
  3. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/preprocess/time_series_aggregation.py +46 -34
  4. {zen_garden-2.8.11 → zen_garden-2.8.12}/LICENSE.txt +0 -0
  5. {zen_garden-2.8.11 → zen_garden-2.8.12}/README.md +0 -0
  6. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/__init__.py +0 -0
  7. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/__main__.py +0 -0
  8. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/cli/__init__.py +0 -0
  9. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/cli/zen_example_cli.py +0 -0
  10. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/cli/zen_garden_cli.py +0 -0
  11. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/cli/zen_visualization_cli.py +0 -0
  12. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/default_config.py +0 -0
  13. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/__init__.py +0 -0
  14. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/carrier/__init__.py +0 -0
  15. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/carrier/carrier.py +0 -0
  16. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/component.py +0 -0
  17. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/element.py +0 -0
  18. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/energy_system.py +0 -0
  19. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/technology/__init__.py +0 -0
  20. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/technology/conversion_technology.py +0 -0
  21. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/technology/retrofitting_technology.py +0 -0
  22. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/technology/storage_technology.py +0 -0
  23. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/technology/technology.py +0 -0
  24. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/technology/transport_technology.py +0 -0
  25. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/model/time_steps.py +0 -0
  26. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/optimization_setup.py +0 -0
  27. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/postprocess/.gitkeep +0 -0
  28. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/postprocess/__init__.py +0 -0
  29. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/postprocess/comparisons.py +0 -0
  30. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/postprocess/postprocess.py +0 -0
  31. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/postprocess/results/__init__.py +0 -0
  32. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/postprocess/results/cache.py +0 -0
  33. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/postprocess/results/results.py +0 -0
  34. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/postprocess/results/solution_loader.py +0 -0
  35. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/preprocess/__init__.py +0 -0
  36. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/preprocess/extract_input_data.py +0 -0
  37. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/preprocess/parameter_change_log.py +0 -0
  38. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/preprocess/unit_handling.py +0 -0
  39. {zen_garden-2.8.11 → zen_garden-2.8.12}/zen_garden/runner.py +0 -0
  40. {zen_garden-2.8.11 → zen_garden-2.8.12}/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.11
3
+ Version: 2.8.12
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>
@@ -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.11"
19
+ version = "2.8.12"
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"
@@ -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.yearly_variation_nonaggregated_ts(element)
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
- if self.conducted_tsa:
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 yearly_variation_nonaggregated_ts(self, element):
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
- continue
362
- # multiply with yearly variation
363
- new_ts = self.multiply_yearly_variation(element, ts, getattr(element, ts))
364
- # overwrite time series
365
- setattr(element, ts, new_ts)
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