flixopt 1.0.12__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.

Files changed (73) 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/release-notes/v2.0.1.md +12 -0
  16. docs/user-guide/Mathematical Notation/Bus.md +33 -0
  17. docs/user-guide/Mathematical Notation/Effects, Penalty & Objective.md +132 -0
  18. docs/user-guide/Mathematical Notation/Flow.md +26 -0
  19. docs/user-guide/Mathematical Notation/LinearConverter.md +21 -0
  20. docs/user-guide/Mathematical Notation/Piecewise.md +49 -0
  21. docs/user-guide/Mathematical Notation/Storage.md +44 -0
  22. docs/user-guide/Mathematical Notation/index.md +22 -0
  23. docs/user-guide/Mathematical Notation/others.md +3 -0
  24. docs/user-guide/index.md +124 -0
  25. {flixOpt → flixopt}/__init__.py +5 -2
  26. {flixOpt → flixopt}/aggregation.py +113 -140
  27. flixopt/calculation.py +455 -0
  28. {flixOpt → flixopt}/commons.py +7 -4
  29. flixopt/components.py +630 -0
  30. {flixOpt → flixopt}/config.py +9 -8
  31. {flixOpt → flixopt}/config.yaml +3 -3
  32. flixopt/core.py +970 -0
  33. flixopt/effects.py +386 -0
  34. flixopt/elements.py +534 -0
  35. flixopt/features.py +1042 -0
  36. flixopt/flow_system.py +409 -0
  37. flixopt/interface.py +265 -0
  38. flixopt/io.py +308 -0
  39. flixopt/linear_converters.py +331 -0
  40. flixopt/plotting.py +1340 -0
  41. flixopt/results.py +898 -0
  42. flixopt/solvers.py +77 -0
  43. flixopt/structure.py +630 -0
  44. flixopt/utils.py +62 -0
  45. flixopt-2.0.1.dist-info/METADATA +145 -0
  46. flixopt-2.0.1.dist-info/RECORD +57 -0
  47. {flixopt-1.0.12.dist-info → flixopt-2.0.1.dist-info}/WHEEL +1 -1
  48. flixopt-2.0.1.dist-info/top_level.txt +6 -0
  49. pics/architecture_flixOpt-pre2.0.0.png +0 -0
  50. pics/architecture_flixOpt.png +0 -0
  51. pics/flixopt-icon.svg +1 -0
  52. pics/pics.pptx +0 -0
  53. scripts/gen_ref_pages.py +54 -0
  54. site/release-notes/_template.txt +32 -0
  55. flixOpt/calculation.py +0 -629
  56. flixOpt/components.py +0 -614
  57. flixOpt/core.py +0 -182
  58. flixOpt/effects.py +0 -410
  59. flixOpt/elements.py +0 -489
  60. flixOpt/features.py +0 -942
  61. flixOpt/flow_system.py +0 -351
  62. flixOpt/interface.py +0 -203
  63. flixOpt/linear_converters.py +0 -325
  64. flixOpt/math_modeling.py +0 -1145
  65. flixOpt/plotting.py +0 -712
  66. flixOpt/results.py +0 -563
  67. flixOpt/solvers.py +0 -21
  68. flixOpt/structure.py +0 -733
  69. flixOpt/utils.py +0 -134
  70. flixopt-1.0.12.dist-info/METADATA +0 -174
  71. flixopt-1.0.12.dist-info/RECORD +0 -29
  72. flixopt-1.0.12.dist-info/top_level.txt +0 -3
  73. {flixopt-1.0.12.dist-info → flixopt-2.0.1.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
+ }