flixopt 2.0.0__py3-none-any.whl → 2.0.1__py3-none-any.whl

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.

@@ -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
flixopt/core.py CHANGED
@@ -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
flixopt/elements.py CHANGED
@@ -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]:
flixopt/plotting.py CHANGED
@@ -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
 
@@ -12,6 +12,7 @@ docs/javascripts/mathjax.js,sha256=lkPNMk5XrDlyut9e5nGHgpN7gFl8OejpdJJ_gRW_14k,4
12
12
  docs/release-notes/_template.txt,sha256=j65E_FDxzimkcMXBrXyF6b2KPm0KAiQlGTxfhQHnN7c,496
13
13
  docs/release-notes/index.md,sha256=6VslOEfF3KQQCbntguRKz7uGWd_W_KIYotP8L1fzAeI,227
14
14
  docs/release-notes/v2.0.0.md,sha256=eauxvCH3O0B054vhbP0G8GdeF2LM__J57VAGYRFQzBg,4676
15
+ docs/release-notes/v2.0.1.md,sha256=nQlfmOkOrOdZ0WVfNAX0BXYbJ2_i9q8SdDW9hOVDAAo,398
15
16
  docs/user-guide/index.md,sha256=fxI_bMjz7czJ5aF_7D7l5rQVpc03WV2EAaBo9y3gB2g,7452
16
17
  docs/user-guide/Mathematical Notation/Bus.md,sha256=getjae_-rNTXbotO0euXwYCq2arBoayKsN9KeFb2u60,1612
17
18
  "docs/user-guide/Mathematical Notation/Effects, Penalty & Objective.md",sha256=RNqcJzNI1E-U01gaeoKu7m-7gjmtDWvjr2Y5JK9YgTA,5685
@@ -28,20 +29,20 @@ flixopt/commons.py,sha256=ZNlUN1z-h9OGHPo-s-n5OLlJaoPZKVGcAdRyGKpMk4M,1256
28
29
  flixopt/components.py,sha256=FjsRI6REC25SPEkJmVn_etR8Yv1_Jup4NoD2QABGhMw,28679
29
30
  flixopt/config.py,sha256=Kt8QYk7hX5qHcQUtfgjM862C6SQr4K2lDvtk_LLER8Y,9085
30
31
  flixopt/config.yaml,sha256=imzAnnhcJhIfKNTTXFB5Td7Pvk5ARn5j720k-oGGRug,392
31
- flixopt/core.py,sha256=18VRtb2uc1Miw9On0IDpPcpLra9LFC99KQ-OQku7sPo,35936
32
+ flixopt/core.py,sha256=JGsnw-VsNCQW2zDl0kMwhcPIzq08DJmcRQ02nLyDvIg,37633
32
33
  flixopt/effects.py,sha256=SGDIlo7VVIlMp-AeAyZx4CRJcUmpjFYqEq3lpBY8NEg,16662
33
- flixopt/elements.py,sha256=FGbnRzO6BL2SR2F3kf7cKg40703lWmk1nnHCU47io4U,24529
34
+ flixopt/elements.py,sha256=xvpC2oOeiWE98LPYFIYkM_4qbgkPYYFzHLQAf-9GUKE,24872
34
35
  flixopt/features.py,sha256=JvtK3NyqPzb5ZpsIt8KoCoTXrWvNoiTwyc-Ds1pDNxs,43768
35
36
  flixopt/flow_system.py,sha256=4D2u2ucLig0GbC7ksCuWXuZPZdkgDzPafv-GhjAxRyk,17479
36
37
  flixopt/interface.py,sha256=EmMteo93XQRanCk4PwVRo7S-bteP-L5EtQqAe0GVIc0,11940
37
38
  flixopt/io.py,sha256=2QKdtu2-mkzSGBIqHtUcF9UaG32nq9qcIRxZghf1hLw,11284
38
39
  flixopt/linear_converters.py,sha256=ej5V_ML_3m1k9HbDnuey6pHEpQtguYkxBXHxWyE9sq0,10936
39
- flixopt/plotting.py,sha256=Ygxj6pkeIH0p2vyrEL0UnKyF2T7CS1OWuojH35By4mM,53942
40
+ flixopt/plotting.py,sha256=wUwBSQxxwy1uui-mi2hgj6h__O6EvxCnocIbX0ewpMk,54111
40
41
  flixopt/results.py,sha256=gzf8M8Ig3uPjPSFRJeF--MrijbUyGkuF-SdVNRl7gnc,35159
41
42
  flixopt/solvers.py,sha256=k1bSoiXec3asWED70-erXkgtpn2C8KRBfSZj0FLviSM,2436
42
43
  flixopt/structure.py,sha256=beq463pSqySAVO6qc0ZBCZ_OnMrBy6dcmP4h6HcI3hI,26339
43
44
  flixopt/utils.py,sha256=f-_vFDvvG27-c_VMpzkv3lb79Yny4rvoSmemushbzhU,1687
44
- flixopt-2.0.0.dist-info/licenses/LICENSE,sha256=HKsZnbrM_3Rvnr_u9cWSG90cBsj5_slaqI_z_qcxnGI,1118
45
+ flixopt-2.0.1.dist-info/licenses/LICENSE,sha256=HKsZnbrM_3Rvnr_u9cWSG90cBsj5_slaqI_z_qcxnGI,1118
45
46
  pics/architecture_flixOpt-pre2.0.0.png,sha256=9RWSA3vys588aadr2437zor-_-xBTQNQ0bAf8xGcu5g,70605
46
47
  pics/architecture_flixOpt.png,sha256=KjN1bJwESbkHmTW7UsJ7dZyiKZlTO7Dx20dg8KlR1HU,260219
47
48
  pics/flixOpt_plotting.jpg,sha256=zn7ZPAtXm5eRTxtOj86e4-PPhHpCar1jqGh7vMBgQGY,518862
@@ -50,7 +51,7 @@ pics/pics.pptx,sha256=ImWeGGvjtWJ6BGruipsnZYmWtHj5sWdbw1NSFePbkC8,683344
50
51
  scripts/gen_ref_pages.py,sha256=AYRtXyz78x5I_Hn0oRtGVbTxgLLj2QNyRX6vWRefPjc,1960
51
52
  site/release-notes/_template.txt,sha256=j65E_FDxzimkcMXBrXyF6b2KPm0KAiQlGTxfhQHnN7c,496
52
53
  tests/ressources/Zeitreihen2020.csv,sha256=kbsDTKZS0iUsNZAS7m3DohzZI_OHHWe44s3GwLvcTLw,1918412
53
- flixopt-2.0.0.dist-info/METADATA,sha256=vZo92bhXIpCQxgKCvLUb8fJ7kfetM5m7bIQFp4Gzodo,7097
54
- flixopt-2.0.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
55
- flixopt-2.0.0.dist-info/top_level.txt,sha256=U8aoMBkjiSFi7j4zgUOVgvgmyT5a1LnIArZI6TWdk-g,37
56
- flixopt-2.0.0.dist-info/RECORD,,
54
+ flixopt-2.0.1.dist-info/METADATA,sha256=0QHc2zLIaJIvs5AQqLPi67P9SlLKv5Gd0EN6rVVKNt4,7111
55
+ flixopt-2.0.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
56
+ flixopt-2.0.1.dist-info/top_level.txt,sha256=U8aoMBkjiSFi7j4zgUOVgvgmyT5a1LnIArZI6TWdk-g,37
57
+ flixopt-2.0.1.dist-info/RECORD,,