flixopt 3.0.1__py3-none-any.whl → 6.0.0rc7__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.
- flixopt/__init__.py +57 -49
- flixopt/carrier.py +159 -0
- flixopt/clustering/__init__.py +51 -0
- flixopt/clustering/base.py +1746 -0
- flixopt/clustering/intercluster_helpers.py +201 -0
- flixopt/color_processing.py +372 -0
- flixopt/comparison.py +819 -0
- flixopt/components.py +848 -270
- flixopt/config.py +853 -496
- flixopt/core.py +111 -98
- flixopt/effects.py +294 -284
- flixopt/elements.py +484 -223
- flixopt/features.py +220 -118
- flixopt/flow_system.py +2026 -389
- flixopt/interface.py +504 -286
- flixopt/io.py +1718 -55
- flixopt/linear_converters.py +291 -230
- flixopt/modeling.py +304 -181
- flixopt/network_app.py +2 -1
- flixopt/optimization.py +788 -0
- flixopt/optimize_accessor.py +373 -0
- flixopt/plot_result.py +143 -0
- flixopt/plotting.py +1177 -1034
- flixopt/results.py +1331 -372
- flixopt/solvers.py +12 -4
- flixopt/statistics_accessor.py +2412 -0
- flixopt/stats_accessor.py +75 -0
- flixopt/structure.py +954 -120
- flixopt/topology_accessor.py +676 -0
- flixopt/transform_accessor.py +2277 -0
- flixopt/types.py +120 -0
- flixopt-6.0.0rc7.dist-info/METADATA +290 -0
- flixopt-6.0.0rc7.dist-info/RECORD +36 -0
- {flixopt-3.0.1.dist-info → flixopt-6.0.0rc7.dist-info}/WHEEL +1 -1
- flixopt/aggregation.py +0 -382
- flixopt/calculation.py +0 -672
- flixopt/commons.py +0 -51
- flixopt/utils.py +0 -86
- flixopt-3.0.1.dist-info/METADATA +0 -209
- flixopt-3.0.1.dist-info/RECORD +0 -26
- {flixopt-3.0.1.dist-info → flixopt-6.0.0rc7.dist-info}/licenses/LICENSE +0 -0
- {flixopt-3.0.1.dist-info → flixopt-6.0.0rc7.dist-info}/top_level.txt +0 -0
flixopt/solvers.py
CHANGED
|
@@ -8,6 +8,8 @@ import logging
|
|
|
8
8
|
from dataclasses import dataclass, field
|
|
9
9
|
from typing import Any, ClassVar
|
|
10
10
|
|
|
11
|
+
from flixopt.config import CONFIG
|
|
12
|
+
|
|
11
13
|
logger = logging.getLogger('flixopt')
|
|
12
14
|
|
|
13
15
|
|
|
@@ -17,14 +19,16 @@ class _Solver:
|
|
|
17
19
|
Abstract base class for solvers.
|
|
18
20
|
|
|
19
21
|
Args:
|
|
20
|
-
mip_gap: Acceptable relative optimality gap in [0.0, 1.0].
|
|
21
|
-
time_limit_seconds: Time limit in seconds.
|
|
22
|
+
mip_gap: Acceptable relative optimality gap in [0.0, 1.0]. Defaults to CONFIG.Solving.mip_gap.
|
|
23
|
+
time_limit_seconds: Time limit in seconds. Defaults to CONFIG.Solving.time_limit_seconds.
|
|
24
|
+
log_to_console: If False, no output to console. Defaults to CONFIG.Solving.log_to_console.
|
|
22
25
|
extra_options: Additional solver options merged into `options`.
|
|
23
26
|
"""
|
|
24
27
|
|
|
25
28
|
name: ClassVar[str]
|
|
26
|
-
mip_gap: float
|
|
27
|
-
time_limit_seconds: int
|
|
29
|
+
mip_gap: float = field(default_factory=lambda: CONFIG.Solving.mip_gap)
|
|
30
|
+
time_limit_seconds: int = field(default_factory=lambda: CONFIG.Solving.time_limit_seconds)
|
|
31
|
+
log_to_console: bool = field(default_factory=lambda: CONFIG.Solving.log_to_console)
|
|
28
32
|
extra_options: dict[str, Any] = field(default_factory=dict)
|
|
29
33
|
|
|
30
34
|
@property
|
|
@@ -45,6 +49,7 @@ class GurobiSolver(_Solver):
|
|
|
45
49
|
Args:
|
|
46
50
|
mip_gap: Acceptable relative optimality gap in [0.0, 1.0]; mapped to Gurobi `MIPGap`.
|
|
47
51
|
time_limit_seconds: Time limit in seconds; mapped to Gurobi `TimeLimit`.
|
|
52
|
+
log_to_console: If False, no output to console.
|
|
48
53
|
extra_options: Additional solver options merged into `options`.
|
|
49
54
|
"""
|
|
50
55
|
|
|
@@ -55,6 +60,7 @@ class GurobiSolver(_Solver):
|
|
|
55
60
|
return {
|
|
56
61
|
'MIPGap': self.mip_gap,
|
|
57
62
|
'TimeLimit': self.time_limit_seconds,
|
|
63
|
+
'LogToConsole': 1 if self.log_to_console else 0,
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
|
|
@@ -65,6 +71,7 @@ class HighsSolver(_Solver):
|
|
|
65
71
|
Attributes:
|
|
66
72
|
mip_gap: Acceptable relative optimality gap in [0.0, 1.0]; mapped to HiGHS `mip_rel_gap`.
|
|
67
73
|
time_limit_seconds: Time limit in seconds; mapped to HiGHS `time_limit`.
|
|
74
|
+
log_to_console: If False, no output to console.
|
|
68
75
|
extra_options: Additional solver options merged into `options`.
|
|
69
76
|
threads (int | None): Number of threads to use. If None, HiGHS chooses.
|
|
70
77
|
"""
|
|
@@ -78,4 +85,5 @@ class HighsSolver(_Solver):
|
|
|
78
85
|
'mip_rel_gap': self.mip_gap,
|
|
79
86
|
'time_limit': self.time_limit_seconds,
|
|
80
87
|
'threads': self.threads,
|
|
88
|
+
'log_to_console': self.log_to_console,
|
|
81
89
|
}
|