Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dee2b23
Fix `charge_state` Constraint in `Storage` leading to incorrect losse…
FBumann Oct 5, 2025
8791012
Fix CHANGELOG.md
FBumann Oct 5, 2025
eb6bab0
Simplify changes from next release
FBumann Oct 5, 2025
1281d82
Update CHANGELOG.md
FBumann Oct 5, 2025
f8c196e
Fix CHANGELOG.md
FBumann Oct 5, 2025
f61a978
chore(deps): update dependency mkdocs-material to v9.6.20 (#369)
renovate[bot] Oct 5, 2025
2cc5af7
Improve renovate.json to automerge ruff despite 0.x version
FBumann Oct 6, 2025
bd1ef9c
chore(deps): update dependency tsam to v2.3.9 (#379)
renovate[bot] Oct 6, 2025
5e66d50
chore(deps): update dependency ruff to v0.13.2 (#378)
renovate[bot] Oct 7, 2025
493ca97
Feature/Improve Configuration options and handling (#385)
FBumann Oct 9, 2025
906fe99
Update CHANGELOG.md
FBumann Oct 9, 2025
f957ee8
Fix CHANGELOG.md
FBumann Oct 9, 2025
f3e765c
Allow blank issues
FBumann Oct 9, 2025
6de4503
Change default logging behaviour to other colors and no file logging
FBumann Oct 10, 2025
daa5840
Use white for INFO
FBumann Oct 10, 2025
d0f24c8
Use terminal default for INFO
FBumann Oct 10, 2025
5175f67
Explicitly use stdout for StreamHandler
FBumann Oct 10, 2025
f4d039b
Use terminal default for Logging color
FBumann Oct 10, 2025
27ae8ef
Add option for loggger name
FBumann Oct 10, 2025
3d0c030
Update CHANGELOG.md
FBumann Oct 10, 2025
a2b5d41
Ensure custom formats are being applied
FBumann Oct 10, 2025
9656066
Catch empty config files
FBumann Oct 10, 2025
a072d07
Update test to match new defaults
FBumann Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
blank_issues_enabled: false
blank_issues_enabled: true
contact_links:
- name: 🤔 Modeling Questions
url: https://github.com/flixOpt/flixopt/discussions/categories/q-a
Expand Down
40 changes: 0 additions & 40 deletions .github/ISSUE_TEMPLATE/general_issue.yml

This file was deleted.

49 changes: 47 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
Formatting is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) & [Gitmoji](https://gitmoji.dev).
For more details regarding the individual PRs and contributors, please refer to our [GitHub releases](https://github.com/flixOpt/flixopt/releases).

---

<!-- This text won't be rendered
Note: The CI will automatically append a "What's Changed" section to the changelog for github releases.
This contains all commits, PRs, and contributors.
Expand Down Expand Up @@ -46,7 +48,6 @@ Please keep the format of the changelog consistent with the other releases, so t
### 💥 Breaking Changes

### ♻️ Changed
- Using `h5netcdf` instead of `netCDF4` for dataset I/O operations. This follows the update in `xarray==2025.09.01`

### 🗑️ Deprecated

Expand All @@ -57,15 +58,59 @@ Please keep the format of the changelog consistent with the other releases, so t
### 🔒 Security

### 📦 Dependencies
- Updated `renovate.config` to treat CalVer packages (xarray and dask) with more care

### 📝 Docs

### 👷 Development
- Enable blank issues

### 🚧 Known Issues

Until here -->

## [2.2.0] - 2025-10-11
**Summary:** This release is a Configuration and Logging management release.

### ✨ Added
- Added `CONFIG.reset()` method to restore configuration to default values
- Added configurable log file rotation settings: `CONFIG.Logging.max_file_size` and `CONFIG.Logging.backup_count`
- Added configurable log format settings: `CONFIG.Logging.date_format` and `CONFIG.Logging.format`
- Added configurable console settings: `CONFIG.Logging.console_width` and `CONFIG.Logging.show_path`
- Added `CONFIG.Logging.Colors` nested class for customizable log level colors using ANSI escape codes (works with both standard and Rich handlers)
- All examples now enable console logging to demonstrate proper logging usage
- Console logging now outputs to `sys.stdout` instead of `sys.stderr` for better compatibility with output redirection

### ♻️ Changed
- Logging and Configuration management changed
- **Breaking**: Console logging is now disabled by default (`CONFIG.Logging.console = False`). Enable it explicitly in your scripts with `CONFIG.Logging.console = True` and `CONFIG.apply()`
- **Breaking**: File logging is now disabled by default (`CONFIG.Logging.file = None`). Set a file path to enable file logging
- Improved default logging colors: DEBUG is now gray (`\033[90m`) for de-emphasized messages, INFO uses terminal default color (`\033[0m`) for clean output

### 🗑️ Deprecated
- `change_logging_level()` function is now deprecated in favor of `CONFIG.Logging.level` and `CONFIG.apply()`. Will be removed in version 3.0.0.

### 🔥 Removed
- Removed unused `config.merge_configs` function from configuration module

### 👷 Development
- Greatly expanded test coverage for `config.py` module
- Added `@pytest.mark.xdist_group` to `TestConfigModule` tests to prevent global config interference

---

## [2.1.11] - 2025-10-05
**Summary:** Important bugfix in `Storage` leading to wrong results due to incorrect discharge losses.

### ♻️ Changed
- Using `h5netcdf` instead of `netCDF4` for dataset I/O operations. This follows the update in `xarray==2025.09.01`

### 🐛 Fixed
- Fix `charge_state` Constraint in `Storage` leading to incorrect losses in discharge and therefore incorrect charge states and discharge values.

### 📦 Dependencies
- Updated `renovate.config` to treat CalVer packages (xarray and dask) with more care
- Updated packaging configuration

---

## [2.1.10] - 2025-09-29
Expand Down
3 changes: 3 additions & 0 deletions examples/00_Minmal/minimal_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import flixopt as fx

if __name__ == '__main__':
# Enable console logging
fx.CONFIG.Logging.console = True
fx.CONFIG.apply()
# --- Define the Flow System, that will hold all elements, and the time steps you want to model ---
timesteps = pd.date_range('2020-01-01', periods=3, freq='h')
flow_system = fx.FlowSystem(timesteps)
Expand Down
3 changes: 3 additions & 0 deletions examples/01_Simple/simple_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import flixopt as fx

if __name__ == '__main__':
# Enable console logging
fx.CONFIG.Logging.console = True
fx.CONFIG.apply()
# --- Create Time Series Data ---
# Heat demand profile (e.g., kW) over time and corresponding power prices
heat_demand_per_h = np.array([30, 0, 90, 110, 110, 20, 20, 20, 20])
Expand Down
3 changes: 3 additions & 0 deletions examples/02_Complex/complex_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import flixopt as fx

if __name__ == '__main__':
# Enable console logging
fx.CONFIG.Logging.console = True
fx.CONFIG.apply()
# --- Experiment Options ---
# Configure options for testing various parameters and behaviors
check_penalty = False
Expand Down
3 changes: 3 additions & 0 deletions examples/02_Complex/complex_example_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import flixopt as fx

if __name__ == '__main__':
# Enable console logging
fx.CONFIG.Logging.console = True
fx.CONFIG.apply()
# --- Load Results ---
try:
results = fx.results.CalculationResults.from_file('results', 'complex example')
Expand Down
3 changes: 3 additions & 0 deletions examples/03_Calculation_types/example_calculation_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
import flixopt as fx

if __name__ == '__main__':
# Enable console logging
fx.CONFIG.Logging.console = True
fx.CONFIG.apply()
# Calculation Types
full, segmented, aggregated = True, True, True

Expand Down
2 changes: 0 additions & 2 deletions flixopt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@
results,
solvers,
)

CONFIG.load_config()
6 changes: 3 additions & 3 deletions flixopt/calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ def main_results(self) -> dict[str, Scalar | dict]:
model.label_of_element: float(model.size.solution)
for component in self.flow_system.components.values()
for model in component.model.all_sub_models
if isinstance(model, InvestmentModel) and float(model.size.solution) >= CONFIG.modeling.EPSILON
if isinstance(model, InvestmentModel) and float(model.size.solution) >= CONFIG.Modeling.epsilon
},
'Not invested': {
model.label_of_element: float(model.size.solution)
for component in self.flow_system.components.values()
for model in component.model.all_sub_models
if isinstance(model, InvestmentModel) and float(model.size.solution) < CONFIG.modeling.EPSILON
if isinstance(model, InvestmentModel) and float(model.size.solution) < CONFIG.Modeling.epsilon
},
},
'Buses with excess': [
Expand Down Expand Up @@ -164,7 +164,7 @@ def solve(self, solver: _Solver, log_file: pathlib.Path | None = None, log_main_
from .io import document_linopy_model

document_linopy_model(self.model, paths.model_documentation)
self.flow_system.to_netcdf(paths.flow_system, engine='h5netcdf')
self.flow_system.to_netcdf(paths.flow_system)
raise RuntimeError(
f'Model was infeasible. Please check {paths.model_documentation=} and {paths.flow_system=} for more information.'
)
Expand Down
2 changes: 1 addition & 1 deletion flixopt/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def do_modeling(self):
charge_state.isel(time=slice(1, None))
== charge_state.isel(time=slice(None, -1)) * ((1 - rel_loss) ** hours_per_step)
+ charge_rate * eff_charge * hours_per_step
- discharge_rate * eff_discharge * hours_per_step,
- discharge_rate * hours_per_step / eff_discharge,
name=f'{self.label_full}|charge_state',
),
'charge_state',
Expand Down
Loading