flixopt 2.2.0b0__py3-none-any.whl → 3.0.0__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.

Files changed (63) hide show
  1. flixopt/__init__.py +35 -1
  2. flixopt/aggregation.py +60 -81
  3. flixopt/calculation.py +381 -196
  4. flixopt/components.py +1022 -359
  5. flixopt/config.py +553 -191
  6. flixopt/core.py +475 -1315
  7. flixopt/effects.py +477 -214
  8. flixopt/elements.py +591 -344
  9. flixopt/features.py +403 -957
  10. flixopt/flow_system.py +781 -293
  11. flixopt/interface.py +1159 -189
  12. flixopt/io.py +50 -55
  13. flixopt/linear_converters.py +384 -92
  14. flixopt/modeling.py +759 -0
  15. flixopt/network_app.py +789 -0
  16. flixopt/plotting.py +273 -135
  17. flixopt/results.py +639 -383
  18. flixopt/solvers.py +25 -21
  19. flixopt/structure.py +928 -442
  20. flixopt/utils.py +34 -5
  21. flixopt-3.0.0.dist-info/METADATA +209 -0
  22. flixopt-3.0.0.dist-info/RECORD +26 -0
  23. {flixopt-2.2.0b0.dist-info → flixopt-3.0.0.dist-info}/WHEEL +1 -1
  24. flixopt-3.0.0.dist-info/top_level.txt +1 -0
  25. docs/examples/00-Minimal Example.md +0 -5
  26. docs/examples/01-Basic Example.md +0 -5
  27. docs/examples/02-Complex Example.md +0 -10
  28. docs/examples/03-Calculation Modes.md +0 -5
  29. docs/examples/index.md +0 -5
  30. docs/faq/contribute.md +0 -49
  31. docs/faq/index.md +0 -3
  32. docs/images/architecture_flixOpt-pre2.0.0.png +0 -0
  33. docs/images/architecture_flixOpt.png +0 -0
  34. docs/images/flixopt-icon.svg +0 -1
  35. docs/javascripts/mathjax.js +0 -18
  36. docs/release-notes/_template.txt +0 -32
  37. docs/release-notes/index.md +0 -7
  38. docs/release-notes/v2.0.0.md +0 -93
  39. docs/release-notes/v2.0.1.md +0 -12
  40. docs/release-notes/v2.1.0.md +0 -31
  41. docs/release-notes/v2.2.0.md +0 -55
  42. docs/user-guide/Mathematical Notation/Bus.md +0 -33
  43. docs/user-guide/Mathematical Notation/Effects, Penalty & Objective.md +0 -132
  44. docs/user-guide/Mathematical Notation/Flow.md +0 -26
  45. docs/user-guide/Mathematical Notation/Investment.md +0 -115
  46. docs/user-guide/Mathematical Notation/LinearConverter.md +0 -21
  47. docs/user-guide/Mathematical Notation/Piecewise.md +0 -49
  48. docs/user-guide/Mathematical Notation/Storage.md +0 -44
  49. docs/user-guide/Mathematical Notation/index.md +0 -22
  50. docs/user-guide/Mathematical Notation/others.md +0 -3
  51. docs/user-guide/index.md +0 -124
  52. flixopt/config.yaml +0 -10
  53. flixopt-2.2.0b0.dist-info/METADATA +0 -146
  54. flixopt-2.2.0b0.dist-info/RECORD +0 -59
  55. flixopt-2.2.0b0.dist-info/top_level.txt +0 -5
  56. pics/architecture_flixOpt-pre2.0.0.png +0 -0
  57. pics/architecture_flixOpt.png +0 -0
  58. pics/flixOpt_plotting.jpg +0 -0
  59. pics/flixopt-icon.svg +0 -1
  60. pics/pics.pptx +0 -0
  61. scripts/gen_ref_pages.py +0 -54
  62. tests/ressources/Zeitreihen2020.csv +0 -35137
  63. {flixopt-2.2.0b0.dist-info → flixopt-3.0.0.dist-info}/licenses/LICENSE +0 -0
flixopt/solvers.py CHANGED
@@ -2,9 +2,11 @@
2
2
  This module contains the solvers of the flixopt framework, making them available to the end user in a compact way.
3
3
  """
4
4
 
5
+ from __future__ import annotations
6
+
5
7
  import logging
6
8
  from dataclasses import dataclass, field
7
- from typing import Any, ClassVar, Dict, Optional
9
+ from typing import Any, ClassVar
8
10
 
9
11
  logger = logging.getLogger('flixopt')
10
12
 
@@ -14,41 +16,42 @@ class _Solver:
14
16
  """
15
17
  Abstract base class for solvers.
16
18
 
17
- Attributes:
18
- mip_gap (float): Solver's mip gap setting. The MIP gap describes the accepted (MILP) objective,
19
- and the lower bound, which is the theoretically optimal solution (LP)
20
- logfile_name (str): Filename for saving the solver log.
19
+ Args:
20
+ mip_gap: Acceptable relative optimality gap in [0.0, 1.0].
21
+ time_limit_seconds: Time limit in seconds.
22
+ extra_options: Additional solver options merged into `options`.
21
23
  """
22
24
 
23
25
  name: ClassVar[str]
24
26
  mip_gap: float
25
27
  time_limit_seconds: int
26
- extra_options: Dict[str, Any] = field(default_factory=dict)
28
+ extra_options: dict[str, Any] = field(default_factory=dict)
27
29
 
28
30
  @property
29
- def options(self) -> Dict[str, Any]:
31
+ def options(self) -> dict[str, Any]:
30
32
  """Return a dictionary of solver options."""
31
33
  return {key: value for key, value in {**self._options, **self.extra_options}.items() if value is not None}
32
34
 
33
35
  @property
34
- def _options(self) -> Dict[str, Any]:
36
+ def _options(self) -> dict[str, Any]:
35
37
  """Return a dictionary of solver options, translated to the solver's API."""
36
38
  raise NotImplementedError
37
39
 
38
40
 
39
41
  class GurobiSolver(_Solver):
40
42
  """
43
+ Gurobi solver configuration.
44
+
41
45
  Args:
42
- mip_gap (float): Solver's mip gap setting. The MIP gap describes the accepted (MILP) objective,
43
- and the lower bound, which is the theoretically optimal solution (LP)
44
- time_limit_seconds (int): Solver's time limit in seconds.
45
- extra_options (str): Filename for saving the solver log.
46
+ mip_gap: Acceptable relative optimality gap in [0.0, 1.0]; mapped to Gurobi `MIPGap`.
47
+ time_limit_seconds: Time limit in seconds; mapped to Gurobi `TimeLimit`.
48
+ extra_options: Additional solver options merged into `options`.
46
49
  """
47
50
 
48
51
  name: ClassVar[str] = 'gurobi'
49
52
 
50
53
  @property
51
- def _options(self) -> Dict[str, Any]:
54
+ def _options(self) -> dict[str, Any]:
52
55
  return {
53
56
  'MIPGap': self.mip_gap,
54
57
  'TimeLimit': self.time_limit_seconds,
@@ -57,19 +60,20 @@ class GurobiSolver(_Solver):
57
60
 
58
61
  class HighsSolver(_Solver):
59
62
  """
60
- Args:
61
- mip_gap (float): Solver's mip gap setting. The MIP gap describes the accepted (MILP) objective,
62
- and the lower bound, which is the theoretically optimal solution (LP)
63
- time_limit_seconds (int): Solver's time limit in seconds.
64
- threads (int): Number of threads to use.
65
- extra_options (str): Filename for saving the solver log.
63
+ HiGHS solver configuration.
64
+
65
+ Attributes:
66
+ mip_gap: Acceptable relative optimality gap in [0.0, 1.0]; mapped to HiGHS `mip_rel_gap`.
67
+ time_limit_seconds: Time limit in seconds; mapped to HiGHS `time_limit`.
68
+ extra_options: Additional solver options merged into `options`.
69
+ threads (int | None): Number of threads to use. If None, HiGHS chooses.
66
70
  """
67
71
 
68
- threads: Optional[int] = None
72
+ threads: int | None = None
69
73
  name: ClassVar[str] = 'highs'
70
74
 
71
75
  @property
72
- def _options(self) -> Dict[str, Any]:
76
+ def _options(self) -> dict[str, Any]:
73
77
  return {
74
78
  'mip_rel_gap': self.mip_gap,
75
79
  'time_limit': self.time_limit_seconds,