flixopt 2.0.0__tar.gz → 2.0.1__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.

Potentially problematic release.


This version of flixopt might be problematic. Click here for more details.

Files changed (88) hide show
  1. {flixopt-2.0.0 → flixopt-2.0.1}/PKG-INFO +2 -2
  2. {flixopt-2.0.0 → flixopt-2.0.1}/README.md +1 -1
  3. flixopt-2.0.1/docs/release-notes/v2.0.1.md +12 -0
  4. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/core.py +59 -3
  5. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/elements.py +22 -17
  6. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/plotting.py +4 -1
  7. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt.egg-info/PKG-INFO +2 -2
  8. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt.egg-info/SOURCES.txt +1 -0
  9. {flixopt-2.0.0 → flixopt-2.0.1}/tests/test_timeseries.py +2 -2
  10. {flixopt-2.0.0 → flixopt-2.0.1}/.github/workflows/deploy-docs.yaml +0 -0
  11. {flixopt-2.0.0 → flixopt-2.0.1}/.github/workflows/python-app.yaml +0 -0
  12. {flixopt-2.0.0 → flixopt-2.0.1}/.gitignore +0 -0
  13. {flixopt-2.0.0 → flixopt-2.0.1}/LICENSE +0 -0
  14. {flixopt-2.0.0 → flixopt-2.0.1}/docs/SUMMARY.md +0 -0
  15. {flixopt-2.0.0 → flixopt-2.0.1}/docs/contribute.md +0 -0
  16. {flixopt-2.0.0 → flixopt-2.0.1}/docs/examples/00-Minimal Example.md +0 -0
  17. {flixopt-2.0.0 → flixopt-2.0.1}/docs/examples/01-Basic Example.md +0 -0
  18. {flixopt-2.0.0 → flixopt-2.0.1}/docs/examples/02-Complex Example.md +0 -0
  19. {flixopt-2.0.0 → flixopt-2.0.1}/docs/examples/03-Calculation Modes.md +0 -0
  20. {flixopt-2.0.0 → flixopt-2.0.1}/docs/examples/index.md +0 -0
  21. {flixopt-2.0.0 → flixopt-2.0.1}/docs/faq/contribute.md +0 -0
  22. {flixopt-2.0.0 → flixopt-2.0.1}/docs/faq/index.md +0 -0
  23. {flixopt-2.0.0 → flixopt-2.0.1}/docs/getting-started.md +0 -0
  24. {flixopt-2.0.0 → flixopt-2.0.1}/docs/images/architecture_flixOpt-pre2.0.0.png +0 -0
  25. {flixopt-2.0.0 → flixopt-2.0.1}/docs/images/architecture_flixOpt.png +0 -0
  26. {flixopt-2.0.0 → flixopt-2.0.1}/docs/images/flixopt-icon.svg +0 -0
  27. {flixopt-2.0.0 → flixopt-2.0.1}/docs/index.md +0 -0
  28. {flixopt-2.0.0 → flixopt-2.0.1}/docs/javascripts/mathjax.js +0 -0
  29. {flixopt-2.0.0 → flixopt-2.0.1}/docs/release-notes/_template.txt +0 -0
  30. {flixopt-2.0.0 → flixopt-2.0.1}/docs/release-notes/index.md +0 -0
  31. {flixopt-2.0.0 → flixopt-2.0.1}/docs/release-notes/v2.0.0.md +0 -0
  32. {flixopt-2.0.0 → flixopt-2.0.1}/docs/user-guide/Mathematical Notation/Bus.md +0 -0
  33. {flixopt-2.0.0 → flixopt-2.0.1}/docs/user-guide/Mathematical Notation/Effects, Penalty & Objective.md +0 -0
  34. {flixopt-2.0.0 → flixopt-2.0.1}/docs/user-guide/Mathematical Notation/Flow.md +0 -0
  35. {flixopt-2.0.0 → flixopt-2.0.1}/docs/user-guide/Mathematical Notation/LinearConverter.md +0 -0
  36. {flixopt-2.0.0 → flixopt-2.0.1}/docs/user-guide/Mathematical Notation/Piecewise.md +0 -0
  37. {flixopt-2.0.0 → flixopt-2.0.1}/docs/user-guide/Mathematical Notation/Storage.md +0 -0
  38. {flixopt-2.0.0 → flixopt-2.0.1}/docs/user-guide/Mathematical Notation/index.md +0 -0
  39. {flixopt-2.0.0 → flixopt-2.0.1}/docs/user-guide/Mathematical Notation/others.md +0 -0
  40. {flixopt-2.0.0 → flixopt-2.0.1}/docs/user-guide/index.md +0 -0
  41. {flixopt-2.0.0 → flixopt-2.0.1}/examples/00_Minmal/minimal_example.py +0 -0
  42. {flixopt-2.0.0 → flixopt-2.0.1}/examples/01_Simple/simple_example.py +0 -0
  43. {flixopt-2.0.0 → flixopt-2.0.1}/examples/02_Complex/complex_example.py +0 -0
  44. {flixopt-2.0.0 → flixopt-2.0.1}/examples/02_Complex/complex_example_results.py +0 -0
  45. {flixopt-2.0.0 → flixopt-2.0.1}/examples/03_Calculation_types/Zeitreihen2020.csv +0 -0
  46. {flixopt-2.0.0 → flixopt-2.0.1}/examples/03_Calculation_types/example_calculation_types.py +0 -0
  47. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/__init__.py +0 -0
  48. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/aggregation.py +0 -0
  49. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/calculation.py +0 -0
  50. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/commons.py +0 -0
  51. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/components.py +0 -0
  52. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/config.py +0 -0
  53. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/config.yaml +0 -0
  54. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/effects.py +0 -0
  55. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/features.py +0 -0
  56. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/flow_system.py +0 -0
  57. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/interface.py +0 -0
  58. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/io.py +0 -0
  59. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/linear_converters.py +0 -0
  60. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/results.py +0 -0
  61. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/solvers.py +0 -0
  62. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/structure.py +0 -0
  63. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt/utils.py +0 -0
  64. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt.egg-info/dependency_links.txt +0 -0
  65. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt.egg-info/requires.txt +0 -0
  66. {flixopt-2.0.0 → flixopt-2.0.1}/flixopt.egg-info/top_level.txt +0 -0
  67. {flixopt-2.0.0 → flixopt-2.0.1}/mkdocs.yml +0 -0
  68. {flixopt-2.0.0 → flixopt-2.0.1}/pics/architecture_flixOpt-pre2.0.0.png +0 -0
  69. {flixopt-2.0.0 → flixopt-2.0.1}/pics/architecture_flixOpt.png +0 -0
  70. {flixopt-2.0.0 → flixopt-2.0.1}/pics/flixOpt_plotting.jpg +0 -0
  71. {flixopt-2.0.0 → flixopt-2.0.1}/pics/flixopt-icon.svg +0 -0
  72. {flixopt-2.0.0 → flixopt-2.0.1}/pics/pics.pptx +0 -0
  73. {flixopt-2.0.0 → flixopt-2.0.1}/pyproject.toml +0 -0
  74. {flixopt-2.0.0 → flixopt-2.0.1}/scripts/gen_ref_pages.py +0 -0
  75. {flixopt-2.0.0 → flixopt-2.0.1}/setup.cfg +0 -0
  76. {flixopt-2.0.0 → flixopt-2.0.1}/site/release-notes/_template.txt +0 -0
  77. {flixopt-2.0.0 → flixopt-2.0.1}/tests/__init__.py +0 -0
  78. {flixopt-2.0.0 → flixopt-2.0.1}/tests/conftest.py +0 -0
  79. {flixopt-2.0.0 → flixopt-2.0.1}/tests/ressources/Zeitreihen2020.csv +0 -0
  80. {flixopt-2.0.0 → flixopt-2.0.1}/tests/run_all_tests.py +0 -0
  81. {flixopt-2.0.0 → flixopt-2.0.1}/tests/test_dataconverter.py +0 -0
  82. {flixopt-2.0.0 → flixopt-2.0.1}/tests/test_examples.py +0 -0
  83. {flixopt-2.0.0 → flixopt-2.0.1}/tests/test_functional.py +0 -0
  84. {flixopt-2.0.0 → flixopt-2.0.1}/tests/test_integration.py +0 -0
  85. {flixopt-2.0.0 → flixopt-2.0.1}/tests/test_io.py +0 -0
  86. {flixopt-2.0.0 → flixopt-2.0.1}/tests/test_plots.py +0 -0
  87. {flixopt-2.0.0 → flixopt-2.0.1}/tests/test_results_plots.py +0 -0
  88. {flixopt-2.0.0 → flixopt-2.0.1}/tests/todos.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flixopt
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Vector based energy and material flow optimization framework in Python.
5
5
  Author-email: "Chair of Building Energy Systems and Heat Supply, TU Dresden" <peter.stange@tu-dresden.de>, Felix Bumann <felixbumann387@gmail.com>, Felix Panitz <baumbude@googlemail.com>, Peter Stange <peter.stange@tu-dresden.de>
6
6
  Maintainer-email: Felix Bumann <felixbumann387@gmail.com>, Peter Stange <peter.stange@tu-dresden.de>
@@ -120,7 +120,7 @@ We recommend installing FlixOpt with all dependencies, which enables additional
120
120
 
121
121
  ## 📚 Documentation
122
122
 
123
- The documentation is available at [https://flixopt.github.io/flixopt/](https://flixopt.github.io/flixopt/)
123
+ The documentation is available at [https://flixopt.github.io/flixopt/latest/](https://flixopt.github.io/flixopt/latest/)
124
124
 
125
125
  ---
126
126
 
@@ -61,7 +61,7 @@ We recommend installing FlixOpt with all dependencies, which enables additional
61
61
 
62
62
  ## 📚 Documentation
63
63
 
64
- The documentation is available at [https://flixopt.github.io/flixopt/](https://flixopt.github.io/flixopt/)
64
+ The documentation is available at [https://flixopt.github.io/flixopt/latest/](https://flixopt.github.io/flixopt/latest/)
65
65
 
66
66
  ---
67
67
 
@@ -0,0 +1,12 @@
1
+ # Release v2.0.1
2
+
3
+ **Release Date:** 2025-04-20
4
+
5
+ ## Improvements
6
+
7
+ * Add logger warning if relative_minimum is used without on_off_parameters in Flow, as this prevents the flow_rate from switching "OFF"
8
+
9
+ ## Bug Fixes
10
+
11
+ * Replace "|" with "__" in filenames when saving figures, as "|" can lead to issues on windows
12
+ * Fixed a Bug that prevented the load factor from working without InvestmentParameters
@@ -426,8 +426,64 @@ class TimeSeries:
426
426
  True if all values in this TimeSeries are greater than other
427
427
  """
428
428
  if isinstance(other, TimeSeries):
429
- return (self.active_data > other.active_data).all().item()
430
- return NotImplemented
429
+ return self.active_data > other.active_data
430
+ return self.active_data > other
431
+
432
+ def __ge__(self, other):
433
+ """
434
+ Compare if this TimeSeries is greater than or equal to another.
435
+
436
+ Args:
437
+ other: Another TimeSeries to compare with
438
+
439
+ Returns:
440
+ True if all values in this TimeSeries are greater than or equal to other
441
+ """
442
+ if isinstance(other, TimeSeries):
443
+ return self.active_data >= other.active_data
444
+ return self.active_data >= other
445
+
446
+ def __lt__(self, other):
447
+ """
448
+ Compare if this TimeSeries is less than another.
449
+
450
+ Args:
451
+ other: Another TimeSeries to compare with
452
+
453
+ Returns:
454
+ True if all values in this TimeSeries are less than other
455
+ """
456
+ if isinstance(other, TimeSeries):
457
+ return self.active_data < other.active_data
458
+ return self.active_data < other
459
+
460
+ def __le__(self, other):
461
+ """
462
+ Compare if this TimeSeries is less than or equal to another.
463
+
464
+ Args:
465
+ other: Another TimeSeries to compare with
466
+
467
+ Returns:
468
+ True if all values in this TimeSeries are less than or equal to other
469
+ """
470
+ if isinstance(other, TimeSeries):
471
+ return self.active_data <= other.active_data
472
+ return self.active_data <= other
473
+
474
+ def __eq__(self, other):
475
+ """
476
+ Compare if this TimeSeries is equal to another.
477
+
478
+ Args:
479
+ other: Another TimeSeries to compare with
480
+
481
+ Returns:
482
+ True if all values in this TimeSeries are equal to other
483
+ """
484
+ if isinstance(other, TimeSeries):
485
+ return self.active_data == other.active_data
486
+ return self.active_data == other
431
487
 
432
488
  def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
433
489
  """
@@ -843,7 +899,7 @@ class TimeSeriesCollection:
843
899
  if isinstance(item, str):
844
900
  return item in self.time_series_data
845
901
  elif isinstance(item, TimeSeries):
846
- return item in self.time_series_data.values()
902
+ return any([item is ts for ts in self.time_series_data.values()])
847
903
  return False
848
904
 
849
905
  @property
@@ -115,7 +115,7 @@ class Bus(Element):
115
115
  )
116
116
 
117
117
  def _plausibility_checks(self) -> None:
118
- if self.excess_penalty_per_flow_hour == 0:
118
+ if self.excess_penalty_per_flow_hour is not None and (self.excess_penalty_per_flow_hour == 0).all():
119
119
  logger.warning(f'In Bus {self.label}, the excess_penalty_per_flow_hour is 0. Use "None" or a value > 0.')
120
120
 
121
121
  @property
@@ -277,6 +277,13 @@ class Flow(Element):
277
277
  f'if you want to allow flows to be switched on and off.'
278
278
  )
279
279
 
280
+ if (self.relative_minimum > 0).any() and self.on_off_parameters is None:
281
+ logger.warning(
282
+ f'Flow {self.label} has a relative_minimum of {self.relative_minimum.active_data} and no on_off_parameters. '
283
+ f'This prevents the flow_rate from switching off (flow_rate = 0). '
284
+ f'Consider using on_off_parameters to allow the flow to be switched on and off.'
285
+ )
286
+
280
287
  @property
281
288
  def label_full(self) -> str:
282
289
  return f'{self.component}({self.label})'
@@ -389,14 +396,13 @@ class FlowModel(ElementModel):
389
396
  flow_hours_per_size_max = self._model.hours_per_step.sum() * self.element.load_factor_max
390
397
  size = self.element.size if self._investment is None else self._investment.size
391
398
 
392
- if self._investment is not None:
393
- self.add(
394
- self._model.add_constraints(
395
- self.total_flow_hours <= size * flow_hours_per_size_max,
396
- name=f'{self.label_full}|{name_short}',
397
- ),
398
- name_short,
399
- )
399
+ self.add(
400
+ self._model.add_constraints(
401
+ self.total_flow_hours <= size * flow_hours_per_size_max,
402
+ name=f'{self.label_full}|{name_short}',
403
+ ),
404
+ name_short,
405
+ )
400
406
 
401
407
  # eq: size * sum(dt)* load_factor_min <= var_sumFlowHours
402
408
  if self.element.load_factor_min is not None:
@@ -404,14 +410,13 @@ class FlowModel(ElementModel):
404
410
  flow_hours_per_size_min = self._model.hours_per_step.sum() * self.element.load_factor_min
405
411
  size = self.element.size if self._investment is None else self._investment.size
406
412
 
407
- if self._investment is not None:
408
- self.add(
409
- self._model.add_constraints(
410
- self.total_flow_hours >= size * flow_hours_per_size_min,
411
- name=f'{self.label_full}|{name_short}',
412
- ),
413
- name_short,
414
- )
413
+ self.add(
414
+ self._model.add_constraints(
415
+ self.total_flow_hours >= size * flow_hours_per_size_min,
416
+ name=f'{self.label_full}|{name_short}',
417
+ ),
418
+ name_short,
419
+ )
415
420
 
416
421
  @property
417
422
  def absolute_flow_rate_bounds(self) -> Tuple[NumericData, NumericData]:
@@ -32,7 +32,9 @@ _portland_colors = [
32
32
  [217 / 255, 30 / 255, 30 / 255], # Red
33
33
  ]
34
34
 
35
- plt.colormaps.register(mcolors.LinearSegmentedColormap.from_list('portland', _portland_colors))
35
+ # Check if the colormap already exists before registering it
36
+ if 'portland' not in plt.colormaps:
37
+ plt.colormaps.register(mcolors.LinearSegmentedColormap.from_list('portland', _portland_colors))
36
38
 
37
39
 
38
40
  ColorType = Union[str, List[str], Dict[str, str]]
@@ -1309,6 +1311,7 @@ def export_figure(
1309
1311
  TypeError: If the figure type is not supported.
1310
1312
  """
1311
1313
  filename = user_path or default_path
1314
+ filename = filename.with_name(filename.name.replace('|', '__'))
1312
1315
  if filename.suffix == '':
1313
1316
  if default_filetype is None:
1314
1317
  raise ValueError('No default filetype provided')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flixopt
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Vector based energy and material flow optimization framework in Python.
5
5
  Author-email: "Chair of Building Energy Systems and Heat Supply, TU Dresden" <peter.stange@tu-dresden.de>, Felix Bumann <felixbumann387@gmail.com>, Felix Panitz <baumbude@googlemail.com>, Peter Stange <peter.stange@tu-dresden.de>
6
6
  Maintainer-email: Felix Bumann <felixbumann387@gmail.com>, Peter Stange <peter.stange@tu-dresden.de>
@@ -120,7 +120,7 @@ We recommend installing FlixOpt with all dependencies, which enables additional
120
120
 
121
121
  ## 📚 Documentation
122
122
 
123
- The documentation is available at [https://flixopt.github.io/flixopt/](https://flixopt.github.io/flixopt/)
123
+ The documentation is available at [https://flixopt.github.io/flixopt/latest/](https://flixopt.github.io/flixopt/latest/)
124
124
 
125
125
  ---
126
126
 
@@ -23,6 +23,7 @@ docs/javascripts/mathjax.js
23
23
  docs/release-notes/_template.txt
24
24
  docs/release-notes/index.md
25
25
  docs/release-notes/v2.0.0.md
26
+ docs/release-notes/v2.0.1.md
26
27
  docs/user-guide/index.md
27
28
  docs/user-guide/Mathematical Notation/Bus.md
28
29
  docs/user-guide/Mathematical Notation/Effects, Penalty & Objective.md
@@ -268,13 +268,13 @@ class TestTimeSeries:
268
268
  ts2 = TimeSeries(data2, 'Series 2')
269
269
 
270
270
  # Test __gt__ method
271
- assert (ts1 > ts2) is True # All values in ts1 are greater than ts2
271
+ assert (ts1 > ts2).all().item()
272
272
 
273
273
  # Test with mixed values
274
274
  data3 = xr.DataArray([5, 25, 15, 45, 25], coords={'time': sample_timesteps}, dims=['time'])
275
275
  ts3 = TimeSeries(data3, 'Series 3')
276
276
 
277
- assert (ts1 > ts3) is False # Not all values in ts1 are greater than ts3
277
+ assert not (ts1 > ts3).all().item() # Not all values in ts1 are greater than ts3
278
278
 
279
279
  def test_numpy_ufunc(self, sample_timeseries):
280
280
  """Test numpy ufunc compatibility."""
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
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