flixopt 1.0.12__py3-none-any.whl → 2.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 (72) hide show
  1. docs/examples/00-Minimal Example.md +5 -0
  2. docs/examples/01-Basic Example.md +5 -0
  3. docs/examples/02-Complex Example.md +10 -0
  4. docs/examples/03-Calculation Modes.md +5 -0
  5. docs/examples/index.md +5 -0
  6. docs/faq/contribute.md +49 -0
  7. docs/faq/index.md +3 -0
  8. docs/images/architecture_flixOpt-pre2.0.0.png +0 -0
  9. docs/images/architecture_flixOpt.png +0 -0
  10. docs/images/flixopt-icon.svg +1 -0
  11. docs/javascripts/mathjax.js +18 -0
  12. docs/release-notes/_template.txt +32 -0
  13. docs/release-notes/index.md +7 -0
  14. docs/release-notes/v2.0.0.md +93 -0
  15. docs/user-guide/Mathematical Notation/Bus.md +33 -0
  16. docs/user-guide/Mathematical Notation/Effects, Penalty & Objective.md +132 -0
  17. docs/user-guide/Mathematical Notation/Flow.md +26 -0
  18. docs/user-guide/Mathematical Notation/LinearConverter.md +21 -0
  19. docs/user-guide/Mathematical Notation/Piecewise.md +49 -0
  20. docs/user-guide/Mathematical Notation/Storage.md +44 -0
  21. docs/user-guide/Mathematical Notation/index.md +22 -0
  22. docs/user-guide/Mathematical Notation/others.md +3 -0
  23. docs/user-guide/index.md +124 -0
  24. {flixOpt → flixopt}/__init__.py +5 -2
  25. {flixOpt → flixopt}/aggregation.py +113 -140
  26. flixopt/calculation.py +455 -0
  27. {flixOpt → flixopt}/commons.py +7 -4
  28. flixopt/components.py +630 -0
  29. {flixOpt → flixopt}/config.py +9 -8
  30. {flixOpt → flixopt}/config.yaml +3 -3
  31. flixopt/core.py +914 -0
  32. flixopt/effects.py +386 -0
  33. flixopt/elements.py +529 -0
  34. flixopt/features.py +1042 -0
  35. flixopt/flow_system.py +409 -0
  36. flixopt/interface.py +265 -0
  37. flixopt/io.py +308 -0
  38. flixopt/linear_converters.py +331 -0
  39. flixopt/plotting.py +1337 -0
  40. flixopt/results.py +898 -0
  41. flixopt/solvers.py +77 -0
  42. flixopt/structure.py +630 -0
  43. flixopt/utils.py +62 -0
  44. flixopt-2.0.0.dist-info/METADATA +145 -0
  45. flixopt-2.0.0.dist-info/RECORD +56 -0
  46. {flixopt-1.0.12.dist-info → flixopt-2.0.0.dist-info}/WHEEL +1 -1
  47. flixopt-2.0.0.dist-info/top_level.txt +6 -0
  48. pics/architecture_flixOpt-pre2.0.0.png +0 -0
  49. pics/architecture_flixOpt.png +0 -0
  50. pics/flixopt-icon.svg +1 -0
  51. pics/pics.pptx +0 -0
  52. scripts/gen_ref_pages.py +54 -0
  53. site/release-notes/_template.txt +32 -0
  54. flixOpt/calculation.py +0 -629
  55. flixOpt/components.py +0 -614
  56. flixOpt/core.py +0 -182
  57. flixOpt/effects.py +0 -410
  58. flixOpt/elements.py +0 -489
  59. flixOpt/features.py +0 -942
  60. flixOpt/flow_system.py +0 -351
  61. flixOpt/interface.py +0 -203
  62. flixOpt/linear_converters.py +0 -325
  63. flixOpt/math_modeling.py +0 -1145
  64. flixOpt/plotting.py +0 -712
  65. flixOpt/results.py +0 -563
  66. flixOpt/solvers.py +0 -21
  67. flixOpt/structure.py +0 -733
  68. flixOpt/utils.py +0 -134
  69. flixopt-1.0.12.dist-info/METADATA +0 -174
  70. flixopt-1.0.12.dist-info/RECORD +0 -29
  71. flixopt-1.0.12.dist-info/top_level.txt +0 -3
  72. {flixopt-1.0.12.dist-info → flixopt-2.0.0.dist-info/licenses}/LICENSE +0 -0
flixopt/solvers.py ADDED
@@ -0,0 +1,77 @@
1
+ """
2
+ This module contains the solvers of the flixopt framework, making them available to the end user in a compact way.
3
+ """
4
+
5
+ import logging
6
+ from dataclasses import dataclass, field
7
+ from typing import Any, ClassVar, Dict, Optional
8
+
9
+ logger = logging.getLogger('flixopt')
10
+
11
+
12
+ @dataclass
13
+ class _Solver:
14
+ """
15
+ Abstract base class for solvers.
16
+
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.
21
+ """
22
+
23
+ name: ClassVar[str]
24
+ mip_gap: float
25
+ time_limit_seconds: int
26
+ extra_options: Dict[str, Any] = field(default_factory=dict)
27
+
28
+ @property
29
+ def options(self) -> Dict[str, Any]:
30
+ """Return a dictionary of solver options."""
31
+ return {key: value for key, value in {**self._options, **self.extra_options}.items() if value is not None}
32
+
33
+ @property
34
+ def _options(self) -> Dict[str, Any]:
35
+ """Return a dictionary of solver options, translated to the solver's API."""
36
+ raise NotImplementedError
37
+
38
+
39
+ class GurobiSolver(_Solver):
40
+ """
41
+ 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
+ """
47
+
48
+ name: ClassVar[str] = 'gurobi'
49
+
50
+ @property
51
+ def _options(self) -> Dict[str, Any]:
52
+ return {
53
+ 'MIPGap': self.mip_gap,
54
+ 'TimeLimit': self.time_limit_seconds,
55
+ }
56
+
57
+
58
+ class HighsSolver(_Solver):
59
+ """
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.
66
+ """
67
+
68
+ threads: Optional[int] = None
69
+ name: ClassVar[str] = 'highs'
70
+
71
+ @property
72
+ def _options(self) -> Dict[str, Any]:
73
+ return {
74
+ 'mip_rel_gap': self.mip_gap,
75
+ 'time_limit': self.time_limit_seconds,
76
+ 'threads': self.threads,
77
+ }