flixopt 2.1.10__py3-none-any.whl → 2.2.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.
- flixopt/__init__.py +0 -2
- flixopt/calculation.py +2 -2
- flixopt/components.py +1 -1
- flixopt/config.py +486 -193
- flixopt/elements.py +5 -5
- flixopt/features.py +6 -6
- flixopt/flow_system.py +2 -1
- flixopt/interface.py +4 -4
- flixopt/io.py +6 -4
- flixopt/results.py +1 -1
- {flixopt-2.1.10.dist-info → flixopt-2.2.0.dist-info}/METADATA +6 -8
- flixopt-2.2.0.dist-info/RECORD +25 -0
- flixopt-2.2.0.dist-info/top_level.txt +1 -0
- docs/examples/00-Minimal Example.md +0 -5
- docs/examples/01-Basic Example.md +0 -5
- docs/examples/02-Complex Example.md +0 -10
- docs/examples/03-Calculation Modes.md +0 -5
- docs/examples/index.md +0 -5
- docs/faq/contribute.md +0 -61
- docs/faq/index.md +0 -3
- docs/images/architecture_flixOpt-pre2.0.0.png +0 -0
- docs/images/architecture_flixOpt.png +0 -0
- docs/images/flixopt-icon.svg +0 -1
- docs/javascripts/mathjax.js +0 -18
- docs/user-guide/Mathematical Notation/Bus.md +0 -33
- docs/user-guide/Mathematical Notation/Effects, Penalty & Objective.md +0 -132
- docs/user-guide/Mathematical Notation/Flow.md +0 -26
- docs/user-guide/Mathematical Notation/InvestParameters.md +0 -3
- docs/user-guide/Mathematical Notation/LinearConverter.md +0 -21
- docs/user-guide/Mathematical Notation/OnOffParameters.md +0 -3
- docs/user-guide/Mathematical Notation/Piecewise.md +0 -49
- docs/user-guide/Mathematical Notation/Storage.md +0 -44
- docs/user-guide/Mathematical Notation/index.md +0 -22
- docs/user-guide/Mathematical Notation/others.md +0 -3
- docs/user-guide/index.md +0 -124
- flixopt/config.yaml +0 -10
- flixopt-2.1.10.dist-info/RECORD +0 -57
- flixopt-2.1.10.dist-info/top_level.txt +0 -5
- pics/architecture_flixOpt-pre2.0.0.png +0 -0
- pics/architecture_flixOpt.png +0 -0
- pics/flixOpt_plotting.jpg +0 -0
- pics/flixopt-icon.svg +0 -1
- pics/pics.pptx +0 -0
- scripts/extract_changelog.py +0 -148
- scripts/extract_release_notes.py +0 -45
- scripts/gen_ref_pages.py +0 -54
- tests/ressources/Zeitreihen2020.csv +0 -35137
- {flixopt-2.1.10.dist-info → flixopt-2.2.0.dist-info}/WHEEL +0 -0
- {flixopt-2.1.10.dist-info → flixopt-2.2.0.dist-info}/licenses/LICENSE +0 -0
flixopt/elements.py
CHANGED
|
@@ -248,7 +248,7 @@ class Flow(Element):
|
|
|
248
248
|
size: Flow capacity or nominal rating. Can be:
|
|
249
249
|
- Scalar value for fixed capacity
|
|
250
250
|
- InvestParameters for investment-based sizing decisions
|
|
251
|
-
- None to use large default value (CONFIG.
|
|
251
|
+
- None to use large default value (CONFIG.Modeling.big)
|
|
252
252
|
relative_minimum: Minimum flow rate as fraction of size.
|
|
253
253
|
Example: 0.2 means flow cannot go below 20% of rated capacity.
|
|
254
254
|
relative_maximum: Maximum flow rate as fraction of size (typically 1.0).
|
|
@@ -356,7 +356,7 @@ class Flow(Element):
|
|
|
356
356
|
`relative_maximum` for upper bounds on optimization variables.
|
|
357
357
|
|
|
358
358
|
Notes:
|
|
359
|
-
- Default size (CONFIG.
|
|
359
|
+
- Default size (CONFIG.Modeling.big) is used when size=None
|
|
360
360
|
- list inputs for previous_flow_rate are converted to NumPy arrays
|
|
361
361
|
- Flow direction is determined by component input/output designation
|
|
362
362
|
|
|
@@ -383,7 +383,7 @@ class Flow(Element):
|
|
|
383
383
|
meta_data: dict | None = None,
|
|
384
384
|
):
|
|
385
385
|
super().__init__(label, meta_data=meta_data)
|
|
386
|
-
self.size = CONFIG.
|
|
386
|
+
self.size = CONFIG.Modeling.big if size is None else size
|
|
387
387
|
self.relative_minimum = relative_minimum
|
|
388
388
|
self.relative_maximum = relative_maximum
|
|
389
389
|
self.fixed_relative_profile = fixed_relative_profile
|
|
@@ -455,11 +455,11 @@ class Flow(Element):
|
|
|
455
455
|
raise PlausibilityError(self.label_full + ': Take care, that relative_minimum <= relative_maximum!')
|
|
456
456
|
|
|
457
457
|
if (
|
|
458
|
-
self.size == CONFIG.
|
|
458
|
+
self.size == CONFIG.Modeling.big and self.fixed_relative_profile is not None
|
|
459
459
|
): # Default Size --> Most likely by accident
|
|
460
460
|
logger.warning(
|
|
461
461
|
f'Flow "{self.label}" has no size assigned, but a "fixed_relative_profile". '
|
|
462
|
-
f'The default size is {CONFIG.
|
|
462
|
+
f'The default size is {CONFIG.Modeling.big}. As "flow_rate = size * fixed_relative_profile", '
|
|
463
463
|
f'the resulting flow_rate will be very high. To fix this, assign a size to the Flow {self}.'
|
|
464
464
|
)
|
|
465
465
|
|
flixopt/features.py
CHANGED
|
@@ -143,7 +143,7 @@ class InvestmentModel(Model):
|
|
|
143
143
|
# eq2: P_invest >= isInvested * max(epsilon, investSize_min)
|
|
144
144
|
self.add(
|
|
145
145
|
self._model.add_constraints(
|
|
146
|
-
self.size >= self.is_invested * np.maximum(CONFIG.
|
|
146
|
+
self.size >= self.is_invested * np.maximum(CONFIG.Modeling.epsilon, self.parameters.minimum_size),
|
|
147
147
|
name=f'{self.label_full}|is_invested_lb',
|
|
148
148
|
),
|
|
149
149
|
'is_invested_lb',
|
|
@@ -304,7 +304,7 @@ class StateModel(Model):
|
|
|
304
304
|
# Constraint: on * lower_bound <= def_var
|
|
305
305
|
self.add(
|
|
306
306
|
self._model.add_constraints(
|
|
307
|
-
self.on * np.maximum(CONFIG.
|
|
307
|
+
self.on * np.maximum(CONFIG.Modeling.epsilon, lb) <= def_var, name=f'{self.label_full}|on_con1'
|
|
308
308
|
),
|
|
309
309
|
'on_con1',
|
|
310
310
|
)
|
|
@@ -314,7 +314,7 @@ class StateModel(Model):
|
|
|
314
314
|
else:
|
|
315
315
|
# Case for multiple defining variables
|
|
316
316
|
ub = sum(bound[1] for bound in self._defining_bounds) / nr_of_def_vars
|
|
317
|
-
lb = CONFIG.
|
|
317
|
+
lb = CONFIG.Modeling.epsilon # TODO: Can this be a bigger value? (maybe the smallest bound?)
|
|
318
318
|
|
|
319
319
|
# Constraint: on * epsilon <= sum(all_defining_variables)
|
|
320
320
|
self.add(
|
|
@@ -337,7 +337,7 @@ class StateModel(Model):
|
|
|
337
337
|
@property
|
|
338
338
|
def previous_states(self) -> np.ndarray:
|
|
339
339
|
"""Computes the previous states {0, 1} of defining variables as a binary array from their previous values."""
|
|
340
|
-
return StateModel.compute_previous_states(self._previous_values, epsilon=CONFIG.
|
|
340
|
+
return StateModel.compute_previous_states(self._previous_values, epsilon=CONFIG.Modeling.epsilon)
|
|
341
341
|
|
|
342
342
|
@property
|
|
343
343
|
def previous_on_states(self) -> np.ndarray:
|
|
@@ -603,14 +603,14 @@ class ConsecutiveStateModel(Model):
|
|
|
603
603
|
elif np.isscalar(binary_values) and not np.isscalar(hours_per_timestep):
|
|
604
604
|
return binary_values * hours_per_timestep[-1]
|
|
605
605
|
|
|
606
|
-
if np.isclose(binary_values[-1], 0, atol=CONFIG.
|
|
606
|
+
if np.isclose(binary_values[-1], 0, atol=CONFIG.Modeling.epsilon):
|
|
607
607
|
return 0
|
|
608
608
|
|
|
609
609
|
if np.isscalar(hours_per_timestep):
|
|
610
610
|
hours_per_timestep = np.ones(len(binary_values)) * hours_per_timestep
|
|
611
611
|
hours_per_timestep: np.ndarray
|
|
612
612
|
|
|
613
|
-
indexes_with_zero_values = np.where(np.isclose(binary_values, 0, atol=CONFIG.
|
|
613
|
+
indexes_with_zero_values = np.where(np.isclose(binary_values, 0, atol=CONFIG.Modeling.epsilon))[0]
|
|
614
614
|
if len(indexes_with_zero_values) == 0:
|
|
615
615
|
nr_of_indexes_with_consecutive_ones = len(binary_values)
|
|
616
616
|
else:
|
flixopt/flow_system.py
CHANGED
|
@@ -211,9 +211,10 @@ class FlowSystem:
|
|
|
211
211
|
ds.attrs = self.as_dict(data_mode='name')
|
|
212
212
|
return ds
|
|
213
213
|
|
|
214
|
-
def to_netcdf(self, path: str | pathlib.Path, compression: int = 0, constants_in_dataset: bool = True):
|
|
214
|
+
def to_netcdf(self, path: str | pathlib.Path, compression: int = 0, constants_in_dataset: bool = True) -> None:
|
|
215
215
|
"""
|
|
216
216
|
Saves the FlowSystem to a netCDF file.
|
|
217
|
+
|
|
217
218
|
Args:
|
|
218
219
|
path: The path to the netCDF file.
|
|
219
220
|
compression: The compression level to use when saving the file.
|
flixopt/interface.py
CHANGED
|
@@ -650,10 +650,10 @@ class InvestParameters(Interface):
|
|
|
650
650
|
fixed_size: When specified, creates a binary investment decision at exactly
|
|
651
651
|
this size. When None, allows continuous sizing between minimum and maximum bounds.
|
|
652
652
|
minimum_size: Lower bound for continuous sizing decisions. Defaults to a small
|
|
653
|
-
positive value (CONFIG.
|
|
653
|
+
positive value (CONFIG.Modeling.epsilon) to avoid numerical issues.
|
|
654
654
|
Ignored when fixed_size is specified.
|
|
655
655
|
maximum_size: Upper bound for continuous sizing decisions. Defaults to a large
|
|
656
|
-
value (CONFIG.
|
|
656
|
+
value (CONFIG.Modeling.big) representing unlimited capacity.
|
|
657
657
|
Ignored when fixed_size is specified.
|
|
658
658
|
optional: Controls whether investment is required. When True (default),
|
|
659
659
|
optimization can choose not to invest. When False, forces investment
|
|
@@ -833,8 +833,8 @@ class InvestParameters(Interface):
|
|
|
833
833
|
self.optional = optional
|
|
834
834
|
self.specific_effects: EffectValuesUserScalar = specific_effects or {}
|
|
835
835
|
self.piecewise_effects = piecewise_effects
|
|
836
|
-
self._minimum_size = minimum_size if minimum_size is not None else CONFIG.
|
|
837
|
-
self._maximum_size = maximum_size if maximum_size is not None else CONFIG.
|
|
836
|
+
self._minimum_size = minimum_size if minimum_size is not None else CONFIG.Modeling.epsilon
|
|
837
|
+
self._maximum_size = maximum_size if maximum_size is not None else CONFIG.Modeling.big # default maximum
|
|
838
838
|
|
|
839
839
|
def transform_data(self, flow_system: FlowSystem):
|
|
840
840
|
self.fix_effects = flow_system.effects.create_effect_values_dict(self.fix_effects)
|
flixopt/io.py
CHANGED
|
@@ -208,6 +208,7 @@ def save_dataset_to_netcdf(
|
|
|
208
208
|
ds: xr.Dataset,
|
|
209
209
|
path: str | pathlib.Path,
|
|
210
210
|
compression: int = 0,
|
|
211
|
+
engine: Literal['netcdf4', 'scipy', 'h5netcdf'] = 'h5netcdf',
|
|
211
212
|
) -> None:
|
|
212
213
|
"""
|
|
213
214
|
Save a dataset to a netcdf file. Store the attrs as a json string in the 'attrs' attribute.
|
|
@@ -226,12 +227,12 @@ def save_dataset_to_netcdf(
|
|
|
226
227
|
|
|
227
228
|
apply_encoding = False
|
|
228
229
|
if compression != 0:
|
|
229
|
-
if importlib.util.find_spec(
|
|
230
|
+
if importlib.util.find_spec(engine) is not None:
|
|
230
231
|
apply_encoding = True
|
|
231
232
|
else:
|
|
232
233
|
logger.warning(
|
|
233
|
-
'Dataset was exported without compression due to missing dependency "
|
|
234
|
-
'Install
|
|
234
|
+
f'Dataset was exported without compression due to missing dependency "{engine}".'
|
|
235
|
+
f'Install {engine} via `pip install {engine}`.'
|
|
235
236
|
)
|
|
236
237
|
ds = ds.copy(deep=True)
|
|
237
238
|
ds.attrs = {'attrs': json.dumps(ds.attrs)}
|
|
@@ -240,6 +241,7 @@ def save_dataset_to_netcdf(
|
|
|
240
241
|
encoding=None
|
|
241
242
|
if not apply_encoding
|
|
242
243
|
else {data_var: {'zlib': True, 'complevel': compression} for data_var in ds.data_vars},
|
|
244
|
+
engine=engine,
|
|
243
245
|
)
|
|
244
246
|
|
|
245
247
|
|
|
@@ -253,7 +255,7 @@ def load_dataset_from_netcdf(path: str | pathlib.Path) -> xr.Dataset:
|
|
|
253
255
|
Returns:
|
|
254
256
|
Dataset: Loaded dataset.
|
|
255
257
|
"""
|
|
256
|
-
ds = xr.load_dataset(str(path))
|
|
258
|
+
ds = xr.load_dataset(str(path), engine='h5netcdf')
|
|
257
259
|
ds.attrs = json.loads(ds.attrs['attrs'])
|
|
258
260
|
return ds
|
|
259
261
|
|
flixopt/results.py
CHANGED
|
@@ -338,7 +338,7 @@ class CalculationResults:
|
|
|
338
338
|
if self.model is None:
|
|
339
339
|
logger.critical('No model in the CalculationResults. Saving the model is not possible.')
|
|
340
340
|
else:
|
|
341
|
-
self.model.to_netcdf(paths.linopy_model)
|
|
341
|
+
self.model.to_netcdf(paths.linopy_model, engine='h5netcdf')
|
|
342
342
|
|
|
343
343
|
if document_model:
|
|
344
344
|
if self.model is None:
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flixopt
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
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>
|
|
7
|
-
License: MIT
|
|
7
|
+
License-Expression: MIT
|
|
8
8
|
Project-URL: homepage, https://tu-dresden.de/ing/maschinenwesen/iet/gewv/forschung/forschungsprojekte/flixopt
|
|
9
9
|
Project-URL: repository, https://github.com/flixOpt/flixopt
|
|
10
10
|
Project-URL: documentation, https://flixopt.github.io/flixopt/
|
|
11
11
|
Keywords: optimization,energy systems,numerical analysis
|
|
12
12
|
Classifier: Development Status :: 3 - Alpha
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -18,7 +17,6 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
18
17
|
Classifier: Intended Audience :: Developers
|
|
19
18
|
Classifier: Intended Audience :: Science/Research
|
|
20
19
|
Classifier: Topic :: Scientific/Engineering
|
|
21
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
22
20
|
Requires-Python: >=3.10
|
|
23
21
|
Description-Content-Type: text/markdown
|
|
24
22
|
License-File: LICENSE
|
|
@@ -26,7 +24,7 @@ Requires-Dist: numpy<3,>=1.21.5
|
|
|
26
24
|
Requires-Dist: pandas<3,>=2.0.0
|
|
27
25
|
Requires-Dist: xarray<2026.0,>=2024.2.0
|
|
28
26
|
Requires-Dist: linopy<0.6,>=0.5.1
|
|
29
|
-
Requires-Dist:
|
|
27
|
+
Requires-Dist: h5netcdf<2,>=1.0.0
|
|
30
28
|
Requires-Dist: pyyaml<7,>=6.0.0
|
|
31
29
|
Requires-Dist: rich<15,>=13.0.0
|
|
32
30
|
Requires-Dist: tomli<3,>=2.0.1; python_version < "3.11"
|
|
@@ -55,10 +53,10 @@ Provides-Extra: dev
|
|
|
55
53
|
Requires-Dist: pytest==8.4.2; extra == "dev"
|
|
56
54
|
Requires-Dist: pytest-xdist==3.8.0; extra == "dev"
|
|
57
55
|
Requires-Dist: nbformat==5.10.4; extra == "dev"
|
|
58
|
-
Requires-Dist: ruff==0.13.
|
|
56
|
+
Requires-Dist: ruff==0.13.2; extra == "dev"
|
|
59
57
|
Requires-Dist: pre-commit==4.3.0; extra == "dev"
|
|
60
58
|
Requires-Dist: pyvis==0.3.2; extra == "dev"
|
|
61
|
-
Requires-Dist: tsam==2.3.
|
|
59
|
+
Requires-Dist: tsam==2.3.9; extra == "dev"
|
|
62
60
|
Requires-Dist: scipy==1.15.1; extra == "dev"
|
|
63
61
|
Requires-Dist: gurobipy==12.0.3; extra == "dev"
|
|
64
62
|
Requires-Dist: dash==3.0.0; extra == "dev"
|
|
@@ -67,7 +65,7 @@ Requires-Dist: dash-daq==0.6.0; extra == "dev"
|
|
|
67
65
|
Requires-Dist: networkx==3.0.0; extra == "dev"
|
|
68
66
|
Requires-Dist: werkzeug==3.0.0; extra == "dev"
|
|
69
67
|
Provides-Extra: docs
|
|
70
|
-
Requires-Dist: mkdocs-material==9.6.
|
|
68
|
+
Requires-Dist: mkdocs-material==9.6.20; extra == "docs"
|
|
71
69
|
Requires-Dist: mkdocstrings-python==1.18.2; extra == "docs"
|
|
72
70
|
Requires-Dist: mkdocs-table-reader-plugin==3.1.0; extra == "docs"
|
|
73
71
|
Requires-Dist: mkdocs-gen-files==0.5.0; extra == "docs"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
flixopt/__init__.py,sha256=WodgPpH8UHORIGh9EucATUTK6ct4ebPDBuSxymZgl3E,666
|
|
2
|
+
flixopt/aggregation.py,sha256=BFy2ngr0a0By5wfBZet9fX8X5ZPmkn1x6HMRaw1ZsTo,16892
|
|
3
|
+
flixopt/calculation.py,sha256=2Dfgpwjmg_dCz9jWHOUpEwIgzggvIPXhiIg8nGl1YMc,24476
|
|
4
|
+
flixopt/commons.py,sha256=ZNlUN1z-h9OGHPo-s-n5OLlJaoPZKVGcAdRyGKpMk4M,1256
|
|
5
|
+
flixopt/components.py,sha256=GhALvEkjGagm6iy2VxU3lVkUPlQOtsnFmu6ZsUDrcwM,54632
|
|
6
|
+
flixopt/config.py,sha256=Gy2k1J4A-TS01jILwgUy9xp38AEMawU_pk0_XseufKI,19889
|
|
7
|
+
flixopt/core.py,sha256=HnXnUXnAL8yqBExdsXGgwu5HnfWRH0omjjMKgp_SBKc,37824
|
|
8
|
+
flixopt/effects.py,sha256=HcalPMUaAfuzD2p1OeQ9nLY2vmHv_GxwyGLLeqNGNZ8,19435
|
|
9
|
+
flixopt/elements.py,sha256=tzQVeh1z98CDv2nm8wiwxY_B2cKMLLZyYwGAoYsNLso,33535
|
|
10
|
+
flixopt/features.py,sha256=hX2485foIxzKQ6DMv73FlIXcSmVhe6n1taeLmfyXE-A,43891
|
|
11
|
+
flixopt/flow_system.py,sha256=tOOGtEzZFISL87lmxNOsYf9uiSfE9XLUzenDBsSf8ns,20895
|
|
12
|
+
flixopt/interface.py,sha256=sBJJxVKIPrl3w8NQ-BRnr_1C65A5i1ZWispPdV6YeVM,47575
|
|
13
|
+
flixopt/io.py,sha256=huFIS1c_1qXR5LJBl1hUmaN_nCxqj0GC1MUqvzObMfA,11477
|
|
14
|
+
flixopt/linear_converters.py,sha256=rKa0AZlJHgDsPF_LVsvrhxhsmVTRanPE0NuKP7OICtg,22668
|
|
15
|
+
flixopt/network_app.py,sha256=LnVAlAgzL1BgMYLsJ20a62j6nQUmNccF1zo4ACUXzL4,29433
|
|
16
|
+
flixopt/plotting.py,sha256=cGM8f5QDMOkKuBapgD6-EhN1X-f5WkDqyoxGPberjzI,59661
|
|
17
|
+
flixopt/results.py,sha256=zSOFbDV7gpvoEUvRvmlP5JUHe-QhOJOuGKgZUsFjiGQ,40701
|
|
18
|
+
flixopt/solvers.py,sha256=m38Smc22MJfHYMiqfNf1MA3OmvbTRm5OWS9nECkDdQk,2355
|
|
19
|
+
flixopt/structure.py,sha256=vyD1lc80NH3JLexKJuar9btgHhEbcNEmihCQkBWea8k,26254
|
|
20
|
+
flixopt/utils.py,sha256=a-YKR7C7HtD8dSIcxzlJTgryV5HMS7zELSXNYr_Lz9Q,1775
|
|
21
|
+
flixopt-2.2.0.dist-info/licenses/LICENSE,sha256=HKsZnbrM_3Rvnr_u9cWSG90cBsj5_slaqI_z_qcxnGI,1118
|
|
22
|
+
flixopt-2.2.0.dist-info/METADATA,sha256=yvVKc1LFjiGo8zDKAVQcaSsMzlrEDbXsn3nhoi4kg0o,8385
|
|
23
|
+
flixopt-2.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
+
flixopt-2.2.0.dist-info/top_level.txt,sha256=fanTzb9NylIXfv6Ic7spU97fVmRgGDPKvI_91tw4S3E,8
|
|
25
|
+
flixopt-2.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
flixopt
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Complex example
|
|
2
|
-
This saves the results of a calculation to file and reloads them to analyze the results
|
|
3
|
-
## Build the Model
|
|
4
|
-
```python
|
|
5
|
-
{! ../examples/02_Complex/complex_example.py !}
|
|
6
|
-
```
|
|
7
|
-
## Load the Results from file
|
|
8
|
-
```python
|
|
9
|
-
{! ../examples/02_Complex/complex_example_results.py !}
|
|
10
|
-
```
|
docs/examples/index.md
DELETED
docs/faq/contribute.md
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Contributing to the Project
|
|
2
|
-
|
|
3
|
-
We warmly welcome contributions from the community! This guide will help you get started with contributing to our project.
|
|
4
|
-
|
|
5
|
-
## Development Setup
|
|
6
|
-
1. Clone the repository `git clone https://github.com/flixOpt/flixopt.git`
|
|
7
|
-
2. Install the development dependencies `pip install -e ".[dev]"`
|
|
8
|
-
3. Install pre-commit hooks `pre-commit install` (one-time setup)
|
|
9
|
-
4. Run `pytest` to ensure your code passes all tests
|
|
10
|
-
|
|
11
|
-
## Code Quality
|
|
12
|
-
We use [Ruff](https://github.com/astral-sh/ruff) for linting and formatting. After the one-time setup above, **code quality checks run automatically on every commit**.
|
|
13
|
-
|
|
14
|
-
To run manually:
|
|
15
|
-
- `ruff check --fix .` to check and fix linting issues
|
|
16
|
-
- `ruff format .` to format code
|
|
17
|
-
|
|
18
|
-
## Documentation (Optional)
|
|
19
|
-
FlixOpt uses [mkdocs](https://www.mkdocs.org/) to generate documentation.
|
|
20
|
-
To work on documentation:
|
|
21
|
-
```bash
|
|
22
|
-
pip install -e ".[docs]"
|
|
23
|
-
mkdocs serve
|
|
24
|
-
```
|
|
25
|
-
Then navigate to http://127.0.0.1:8000/
|
|
26
|
-
|
|
27
|
-
## Testing
|
|
28
|
-
- `pytest` to run the test suite
|
|
29
|
-
- You can also run the provided python script `run_all_test.py`
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
# Best practices
|
|
33
|
-
|
|
34
|
-
## Coding Guidelines
|
|
35
|
-
|
|
36
|
-
- Follow PEP 8 style guidelines
|
|
37
|
-
- Write clear, commented code
|
|
38
|
-
- Include type hints
|
|
39
|
-
- Create or update tests for new functionality
|
|
40
|
-
- Ensure 100% test coverage for new code
|
|
41
|
-
|
|
42
|
-
## Branches
|
|
43
|
-
As we start to think FlixOpt in **Releases**, we decided to introduce multiple **dev**-branches instead of only one:
|
|
44
|
-
Following the **Semantic Versioning** guidelines, we introduced:
|
|
45
|
-
- `next/patch`: This is where all pull requests for the next patch release (1.0.x) go.
|
|
46
|
-
- `next/minor`: This is where all pull requests for the next minor release (1.x.0) go.
|
|
47
|
-
- `next/major`: This is where all pull requests for the next major release (x.0.0) go.
|
|
48
|
-
|
|
49
|
-
Everything else remains in `feature/...`-branches.
|
|
50
|
-
|
|
51
|
-
## Pull requests
|
|
52
|
-
Every feature or bugfix should be merged into one of the 3 [release branches](#branches), using **Squash and merge** or a regular **single commit**.
|
|
53
|
-
At some point, `next/minor` or `next/major` will get merged into `main` using a regular **Merge** (not squash).
|
|
54
|
-
*This ensures that Features are kept separate, and the `next/...`branches stay in synch with ``main`.*
|
|
55
|
-
|
|
56
|
-
## Releases
|
|
57
|
-
As stated, we follow **Semantic Versioning**.
|
|
58
|
-
Right after one of the 3 [release branches](#branches) is merged into main, a **Tag** should be added to the merge commit and pushed to the main branch. The tag has the form `v1.2.3`.
|
|
59
|
-
With this tag, a release with **Release Notes** must be created.
|
|
60
|
-
|
|
61
|
-
*This is our current best practice*
|
docs/faq/index.md
DELETED
|
Binary file
|
|
Binary file
|