flixopt 3.2.0__py3-none-any.whl → 3.2.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.

flixopt/flow_system.py CHANGED
@@ -80,7 +80,7 @@ class FlowSystem(Interface):
80
80
  timesteps: pd.DatetimeIndex,
81
81
  periods: pd.Index | None = None,
82
82
  scenarios: pd.Index | None = None,
83
- hours_of_last_timestep: float | None = None,
83
+ hours_of_last_timestep: int | float | None = None,
84
84
  hours_of_previous_timesteps: int | float | np.ndarray | None = None,
85
85
  weights: PeriodicDataUser | None = None,
86
86
  scenario_independent_sizes: bool | list[str] = True,
@@ -929,6 +929,8 @@ class FlowSystem(Interface):
929
929
  self,
930
930
  time: str,
931
931
  method: Literal['mean', 'sum', 'max', 'min', 'first', 'last', 'std', 'var', 'median', 'count'] = 'mean',
932
+ hours_of_last_timestep: int | float | None = None,
933
+ hours_of_previous_timesteps: int | float | np.ndarray | None = None,
932
934
  **kwargs: Any,
933
935
  ) -> FlowSystem:
934
936
  """
@@ -938,10 +940,12 @@ class FlowSystem(Interface):
938
940
  Args:
939
941
  time: Resampling frequency (e.g., '3h', '2D', '1M')
940
942
  method: Resampling method. Recommended: 'mean', 'first', 'last', 'max', 'min'
943
+ hours_of_last_timestep: New duration of the last time step. Defaults to the last time interval of the new timesteps
944
+ hours_of_previous_timesteps: New duration of the previous timestep. Defaults to the first time increment of the new timesteps
941
945
  **kwargs: Additional arguments passed to xarray.resample()
942
946
 
943
947
  Returns:
944
- FlowSystem: New FlowSystem with resampled data
948
+ FlowSystem: New resampled FlowSystem
945
949
  """
946
950
  if not self.connected_and_transformed:
947
951
  self.connect_and_transform()
@@ -975,6 +979,10 @@ class FlowSystem(Interface):
975
979
  else:
976
980
  resampled_dataset = resampled_time_data
977
981
 
982
+ # Let FlowSystem recalculate or use explicitly set value
983
+ resampled_dataset.attrs['hours_of_last_timestep'] = hours_of_last_timestep
984
+ resampled_dataset.attrs['hours_of_previous_timesteps'] = hours_of_previous_timesteps
985
+
978
986
  return self.__class__.from_dataset(resampled_dataset)
979
987
 
980
988
  @property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flixopt
3
- Version: 3.2.0
3
+ Version: 3.2.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>
@@ -67,7 +67,7 @@ Requires-Dist: networkx==3.0.0; extra == "dev"
67
67
  Requires-Dist: werkzeug==3.0.0; extra == "dev"
68
68
  Provides-Extra: docs
69
69
  Requires-Dist: mkdocs==1.6.1; extra == "docs"
70
- Requires-Dist: mkdocs-material==9.6.21; extra == "docs"
70
+ Requires-Dist: mkdocs-material==9.6.22; extra == "docs"
71
71
  Requires-Dist: mkdocstrings-python==1.18.2; extra == "docs"
72
72
  Requires-Dist: mkdocs-table-reader-plugin==3.1.0; extra == "docs"
73
73
  Requires-Dist: mkdocs-gen-files==0.5.0; extra == "docs"
@@ -9,7 +9,7 @@ flixopt/core.py,sha256=OG789eUaS5Lu0CjJiMIdtaixqnV5ZtMiKfERjCPRTv8,26366
9
9
  flixopt/effects.py,sha256=1UZaqmjHEjMahbKBcmgXP3JojIRDhUZKjPgLgOAJvO0,34056
10
10
  flixopt/elements.py,sha256=92SQ3ax57I9VLjhe0-4L6u3jaYDylrKcmuSFGuzneqI,36371
11
11
  flixopt/features.py,sha256=kd-fMvADv8GXoKkrXObYjRJLN8toBG-5bOHTuh-59kk,25073
12
- flixopt/flow_system.py,sha256=HI4nOGRFjleumBcusjCU1Momw0DN7Q2oCgy0gU0dCug,40339
12
+ flixopt/flow_system.py,sha256=UCR37soFp1IEdNoATOa_eBFEYEwYdWk5QS63Fy9j9wI,40979
13
13
  flixopt/interface.py,sha256=ACWFIwdbjVN0x52QukKetpJgM0YGsWpvlBAtFnHgHa4,57925
14
14
  flixopt/io.py,sha256=1vjwFTyAr2ohkiwqE4qVX9juAG0l1wgxltcWcEPaFcQ,18895
15
15
  flixopt/linear_converters.py,sha256=tcz5c1SI36hRFbCX-4NXced12ss9VETg5BE7zOdyeo4,22699
@@ -19,8 +19,8 @@ flixopt/plotting.py,sha256=C_VyBVQIUP1HYt8roXk__Gz9m17cSSPikXZL4jidIpg,65024
19
19
  flixopt/results.py,sha256=gZAj-BQpb7CHp0CcYy99ZF4_IEZvJnQfTeOEZe2TdCU,118942
20
20
  flixopt/solvers.py,sha256=m38Smc22MJfHYMiqfNf1MA3OmvbTRm5OWS9nECkDdQk,2355
21
21
  flixopt/structure.py,sha256=CrMqp1rzo45S-XJTVmJW4kQWh-a_ukz38uBp18LnBLU,47585
22
- flixopt-3.2.0.dist-info/licenses/LICENSE,sha256=HKsZnbrM_3Rvnr_u9cWSG90cBsj5_slaqI_z_qcxnGI,1118
23
- flixopt-3.2.0.dist-info/METADATA,sha256=uBnKopA20TTqYiHXdbxW1X3szcF4s4HS2JqBUXQ8cao,12855
24
- flixopt-3.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
- flixopt-3.2.0.dist-info/top_level.txt,sha256=fanTzb9NylIXfv6Ic7spU97fVmRgGDPKvI_91tw4S3E,8
26
- flixopt-3.2.0.dist-info/RECORD,,
22
+ flixopt-3.2.1.dist-info/licenses/LICENSE,sha256=HKsZnbrM_3Rvnr_u9cWSG90cBsj5_slaqI_z_qcxnGI,1118
23
+ flixopt-3.2.1.dist-info/METADATA,sha256=DD5949y3Ldjxkt08Vb47Hy6oQbDKk6-DGnXmhFCf6GI,12855
24
+ flixopt-3.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ flixopt-3.2.1.dist-info/top_level.txt,sha256=fanTzb9NylIXfv6Ic7spU97fVmRgGDPKvI_91tw4S3E,8
26
+ flixopt-3.2.1.dist-info/RECORD,,