flixopt 3.0.0__py3-none-any.whl → 3.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.
- flixopt/calculation.py +9 -5
- flixopt/config.py +1 -1
- flixopt/core.py +3 -3
- flixopt/modeling.py +2 -4
- flixopt/results.py +2 -2
- flixopt/utils.py +3 -5
- {flixopt-3.0.0.dist-info → flixopt-3.0.1.dist-info}/METADATA +3 -3
- {flixopt-3.0.0.dist-info → flixopt-3.0.1.dist-info}/RECORD +11 -11
- {flixopt-3.0.0.dist-info → flixopt-3.0.1.dist-info}/WHEEL +0 -0
- {flixopt-3.0.0.dist-info → flixopt-3.0.1.dist-info}/licenses/LICENSE +0 -0
- {flixopt-3.0.0.dist-info → flixopt-3.0.1.dist-info}/top_level.txt +0 -0
flixopt/calculation.py
CHANGED
|
@@ -23,7 +23,7 @@ import yaml
|
|
|
23
23
|
|
|
24
24
|
from . import io as fx_io
|
|
25
25
|
from . import utils as utils
|
|
26
|
-
from .aggregation import AggregationModel, AggregationParameters
|
|
26
|
+
from .aggregation import Aggregation, AggregationModel, AggregationParameters
|
|
27
27
|
from .components import Storage
|
|
28
28
|
from .config import CONFIG
|
|
29
29
|
from .core import DataConverter, Scalar, TimeSeriesData, drop_constant_arrays
|
|
@@ -286,7 +286,10 @@ class AggregatedCalculation(FullCalculation):
|
|
|
286
286
|
This equalizes variables in the components according to the typical periods computed in the aggregation
|
|
287
287
|
active_timesteps: DatetimeIndex of timesteps to use for calculation. If None, all timesteps are used
|
|
288
288
|
folder: Folder where results should be saved. If None, current working directory is used
|
|
289
|
-
|
|
289
|
+
|
|
290
|
+
Attributes:
|
|
291
|
+
aggregation (Aggregation | None): Contains the clustered time series data
|
|
292
|
+
aggregation_model (AggregationModel | None): Contains Variables and Constraints that equalize clusters of the time series data
|
|
290
293
|
"""
|
|
291
294
|
|
|
292
295
|
def __init__(
|
|
@@ -306,7 +309,8 @@ class AggregatedCalculation(FullCalculation):
|
|
|
306
309
|
super().__init__(name, flow_system, active_timesteps, folder=folder)
|
|
307
310
|
self.aggregation_parameters = aggregation_parameters
|
|
308
311
|
self.components_to_clusterize = components_to_clusterize
|
|
309
|
-
self.aggregation = None
|
|
312
|
+
self.aggregation: Aggregation | None = None
|
|
313
|
+
self.aggregation_model: AggregationModel | None = None
|
|
310
314
|
|
|
311
315
|
def do_modeling(self) -> AggregatedCalculation:
|
|
312
316
|
t_start = timeit.default_timer()
|
|
@@ -317,10 +321,10 @@ class AggregatedCalculation(FullCalculation):
|
|
|
317
321
|
self.model = self.flow_system.create_model(self.normalize_weights)
|
|
318
322
|
self.model.do_modeling()
|
|
319
323
|
# Add Aggregation Submodel after modeling the rest
|
|
320
|
-
self.
|
|
324
|
+
self.aggregation_model = AggregationModel(
|
|
321
325
|
self.model, self.aggregation_parameters, self.flow_system, self.aggregation, self.components_to_clusterize
|
|
322
326
|
)
|
|
323
|
-
self.
|
|
327
|
+
self.aggregation_model.do_modeling()
|
|
324
328
|
self.durations['modeling'] = round(timeit.default_timer() - t_start, 2)
|
|
325
329
|
return self
|
|
326
330
|
|
flixopt/config.py
CHANGED
flixopt/core.py
CHANGED
|
@@ -6,7 +6,7 @@ It provides Datatypes, logging functionality, and some functions to transform da
|
|
|
6
6
|
import logging
|
|
7
7
|
import warnings
|
|
8
8
|
from itertools import permutations
|
|
9
|
-
from typing import Literal, Union
|
|
9
|
+
from typing import Any, Literal, Union
|
|
10
10
|
|
|
11
11
|
import numpy as np
|
|
12
12
|
import pandas as pd
|
|
@@ -46,12 +46,12 @@ class TimeSeriesData(xr.DataArray):
|
|
|
46
46
|
|
|
47
47
|
def __init__(
|
|
48
48
|
self,
|
|
49
|
-
*args,
|
|
49
|
+
*args: Any,
|
|
50
50
|
aggregation_group: str | None = None,
|
|
51
51
|
aggregation_weight: float | None = None,
|
|
52
52
|
agg_group: str | None = None,
|
|
53
53
|
agg_weight: float | None = None,
|
|
54
|
-
**kwargs,
|
|
54
|
+
**kwargs: Any,
|
|
55
55
|
):
|
|
56
56
|
"""
|
|
57
57
|
Args:
|
flixopt/modeling.py
CHANGED
|
@@ -396,7 +396,7 @@ class BoundingPatterns:
|
|
|
396
396
|
variable: linopy.Variable,
|
|
397
397
|
bounds: tuple[TemporalData, TemporalData],
|
|
398
398
|
name: str = None,
|
|
399
|
-
):
|
|
399
|
+
) -> list[linopy.constraints.Constraint]:
|
|
400
400
|
"""Create simple bounds.
|
|
401
401
|
variable ∈ [lower_bound, upper_bound]
|
|
402
402
|
|
|
@@ -409,9 +409,7 @@ class BoundingPatterns:
|
|
|
409
409
|
bounds: Tuple of (lower_bound, upper_bound) absolute bounds
|
|
410
410
|
|
|
411
411
|
Returns:
|
|
412
|
-
|
|
413
|
-
- variables (Dict): Empty dict
|
|
414
|
-
- constraints (Dict[str, linopy.Constraint]): 'ub', 'lb'
|
|
412
|
+
List containing lower_bound and upper_bound constraints
|
|
415
413
|
"""
|
|
416
414
|
if not isinstance(model, Submodel):
|
|
417
415
|
raise ValueError('BoundingPatterns.basic_bounds() can only be used with a Submodel')
|
flixopt/results.py
CHANGED
|
@@ -1243,7 +1243,7 @@ class ComponentResults(_NodeResults):
|
|
|
1243
1243
|
class EffectResults(_ElementResults):
|
|
1244
1244
|
"""Results for an Effect"""
|
|
1245
1245
|
|
|
1246
|
-
def get_shares_from(self, element: str):
|
|
1246
|
+
def get_shares_from(self, element: str) -> xr.Dataset:
|
|
1247
1247
|
"""Get effect shares from specific element.
|
|
1248
1248
|
|
|
1249
1249
|
Args:
|
|
@@ -1399,7 +1399,7 @@ class SegmentedCalculationResults:
|
|
|
1399
1399
|
)
|
|
1400
1400
|
|
|
1401
1401
|
@classmethod
|
|
1402
|
-
def from_file(cls, folder: str | pathlib.Path, name: str):
|
|
1402
|
+
def from_file(cls, folder: str | pathlib.Path, name: str) -> SegmentedCalculationResults:
|
|
1403
1403
|
"""Load SegmentedCalculationResults from saved files.
|
|
1404
1404
|
|
|
1405
1405
|
Args:
|
flixopt/utils.py
CHANGED
|
@@ -5,7 +5,7 @@ This module contains several utility functions used throughout the flixopt frame
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
7
7
|
import logging
|
|
8
|
-
from typing import Literal
|
|
8
|
+
from typing import Any, Literal
|
|
9
9
|
|
|
10
10
|
import numpy as np
|
|
11
11
|
import xarray as xr
|
|
@@ -13,7 +13,7 @@ import xarray as xr
|
|
|
13
13
|
logger = logging.getLogger('flixopt')
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
def round_nested_floats(obj, decimals=2):
|
|
16
|
+
def round_nested_floats(obj: dict | list | float | int | Any, decimals: int = 2) -> dict | list | float | int | Any:
|
|
17
17
|
"""Recursively round floating point numbers in nested data structures.
|
|
18
18
|
|
|
19
19
|
This function traverses nested data structures (dictionaries, lists) and rounds
|
|
@@ -27,9 +27,7 @@ def round_nested_floats(obj, decimals=2):
|
|
|
27
27
|
decimals (int, optional): Number of decimal places to round to. Defaults to 2.
|
|
28
28
|
|
|
29
29
|
Returns:
|
|
30
|
-
The processed object with the same structure as the input, but with all
|
|
31
|
-
floating point numbers rounded to the specified precision. NumPy arrays
|
|
32
|
-
and xarray DataArrays are converted to lists.
|
|
30
|
+
The processed object with the same structure as the input, but with all floating point numbers rounded to the specified precision. NumPy arrays and xarray DataArrays are converted to lists.
|
|
33
31
|
|
|
34
32
|
Examples:
|
|
35
33
|
>>> data = {'a': 3.14159, 'b': [1.234, 2.678]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flixopt
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.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>
|
|
@@ -54,7 +54,7 @@ Provides-Extra: dev
|
|
|
54
54
|
Requires-Dist: pytest==8.4.2; extra == "dev"
|
|
55
55
|
Requires-Dist: pytest-xdist==3.8.0; extra == "dev"
|
|
56
56
|
Requires-Dist: nbformat==5.10.4; extra == "dev"
|
|
57
|
-
Requires-Dist: ruff==0.13.
|
|
57
|
+
Requires-Dist: ruff==0.13.3; extra == "dev"
|
|
58
58
|
Requires-Dist: pre-commit==4.3.0; extra == "dev"
|
|
59
59
|
Requires-Dist: pyvis==0.3.2; extra == "dev"
|
|
60
60
|
Requires-Dist: tsam==2.3.9; extra == "dev"
|
|
@@ -66,7 +66,7 @@ Requires-Dist: dash-daq==0.6.0; extra == "dev"
|
|
|
66
66
|
Requires-Dist: networkx==3.0.0; extra == "dev"
|
|
67
67
|
Requires-Dist: werkzeug==3.0.0; extra == "dev"
|
|
68
68
|
Provides-Extra: docs
|
|
69
|
-
Requires-Dist: mkdocs-material==9.6.
|
|
69
|
+
Requires-Dist: mkdocs-material==9.6.21; extra == "docs"
|
|
70
70
|
Requires-Dist: mkdocstrings-python==1.18.2; extra == "docs"
|
|
71
71
|
Requires-Dist: mkdocs-table-reader-plugin==3.1.0; extra == "docs"
|
|
72
72
|
Requires-Dist: mkdocs-gen-files==0.5.0; extra == "docs"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
flixopt/__init__.py,sha256=8F0MKV9GAsFSP5OCZgn1dwzGD7-bZpsmVnTVe56ZcU8,2204
|
|
2
2
|
flixopt/aggregation.py,sha256=P374vIJc1ZcPxxG8dfCPgUKNLRNP2kf8Y-sc1JOA45U,16191
|
|
3
|
-
flixopt/calculation.py,sha256=
|
|
3
|
+
flixopt/calculation.py,sha256=jeJzTazlG-KJh4M5VMlEqF-_nwIdtVYN3Z94CfKG8yI,29661
|
|
4
4
|
flixopt/commons.py,sha256=ZNlUN1z-h9OGHPo-s-n5OLlJaoPZKVGcAdRyGKpMk4M,1256
|
|
5
5
|
flixopt/components.py,sha256=bm76uCaXkeLuDBfsJ1kjfaHOl8zmow2JTaNPCK4Jknc,57757
|
|
6
|
-
flixopt/config.py,sha256=
|
|
7
|
-
flixopt/core.py,sha256=
|
|
6
|
+
flixopt/config.py,sha256=kB-KyPKtmHoK1zwGp1HV8iJShVsjmi2d5SrGmL_uHxA,22000
|
|
7
|
+
flixopt/core.py,sha256=OG789eUaS5Lu0CjJiMIdtaixqnV5ZtMiKfERjCPRTv8,26366
|
|
8
8
|
flixopt/effects.py,sha256=iLVC4VdFTtZaF6B8BJiILRwe9ahj93og8JQSaAE_ocI,34063
|
|
9
9
|
flixopt/elements.py,sha256=D4EkYZxqtyBhpTYf6C82pBRJf5fjyGXxZ8HMNiaHCuA,36156
|
|
10
10
|
flixopt/features.py,sha256=kd-fMvADv8GXoKkrXObYjRJLN8toBG-5bOHTuh-59kk,25073
|
|
@@ -12,15 +12,15 @@ flixopt/flow_system.py,sha256=D84MIkX5oA_4H55p9mOC7tstV96V5RN2qPeJ2exX1ks,40242
|
|
|
12
12
|
flixopt/interface.py,sha256=iLc2-_adqSeljlJrX6tao8IxBCQcksq4S7HQDw9L_OM,57503
|
|
13
13
|
flixopt/io.py,sha256=2ZnpoU4gVnKfv-FiwoYEA11wlqbdUU8PXJiofRSKl5M,11795
|
|
14
14
|
flixopt/linear_converters.py,sha256=tcz5c1SI36hRFbCX-4NXced12ss9VETg5BE7zOdyeo4,22699
|
|
15
|
-
flixopt/modeling.py,sha256=
|
|
15
|
+
flixopt/modeling.py,sha256=s0zipbblq-LJrSe7angKT3Imxgr3kIbprG98HUvmkzI,31322
|
|
16
16
|
flixopt/network_app.py,sha256=LnVAlAgzL1BgMYLsJ20a62j6nQUmNccF1zo4ACUXzL4,29433
|
|
17
17
|
flixopt/plotting.py,sha256=lHeSwfSaQCGP2w54S8CzSa7sWwCxMcWci1EU1TYqLWM,60909
|
|
18
|
-
flixopt/results.py,sha256=
|
|
18
|
+
flixopt/results.py,sha256=rgyYJTcgF1DOxYSvKM__BTfVU13o13DwSBjvA4o4gdM,77773
|
|
19
19
|
flixopt/solvers.py,sha256=m38Smc22MJfHYMiqfNf1MA3OmvbTRm5OWS9nECkDdQk,2355
|
|
20
20
|
flixopt/structure.py,sha256=ntLoj--zTnaZwNYKw-WkJTNxY0ef4zDp4S0iiSxyyxE,47707
|
|
21
|
-
flixopt/utils.py,sha256=
|
|
22
|
-
flixopt-3.0.
|
|
23
|
-
flixopt-3.0.
|
|
24
|
-
flixopt-3.0.
|
|
25
|
-
flixopt-3.0.
|
|
26
|
-
flixopt-3.0.
|
|
21
|
+
flixopt/utils.py,sha256=CtCMBjvq31upz7i-_1nbPnSe-1CoRoOWlPkucwiSo5Q,2930
|
|
22
|
+
flixopt-3.0.1.dist-info/licenses/LICENSE,sha256=HKsZnbrM_3Rvnr_u9cWSG90cBsj5_slaqI_z_qcxnGI,1118
|
|
23
|
+
flixopt-3.0.1.dist-info/METADATA,sha256=TJLBIM5v232UVDWCn5Mrq0-HAfjTW0OBUNC8KbQQIPY,10776
|
|
24
|
+
flixopt-3.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
25
|
+
flixopt-3.0.1.dist-info/top_level.txt,sha256=fanTzb9NylIXfv6Ic7spU97fVmRgGDPKvI_91tw4S3E,8
|
|
26
|
+
flixopt-3.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|