Skip to content

v6.1.0

Choose a tag to compare

@github-actions github-actions released this 17 Mar 15:52
· 36 commits to main since this release

Summary: Adds solver log capture through the Python logging system, exposes progress and log_fn parameters on solve/optimize, and fixes cluster_weight loss during NetCDF roundtrip.

✨ Added

  • Solver log capture: New CONFIG.Solving.capture_solver_log option routes solver output (HiGHS, Gurobi, etc.) through the flixopt.solver Python logger at INFO level. This allows capturing solver output in any Python log handler (console, file, or both) and filtering it independently from flixopt application logs. Enabled automatically by CONFIG.debug(), CONFIG.exploring(), CONFIG.production(), and CONFIG.notebook() presets. (#606)
  • progress parameter: solve(), optimize(), and rolling_horizon() now accept a progress parameter (default True) to control the tqdm progress bar independently of CONFIG settings.
  • log_fn parameter: solve() now accepts a log_fn parameter to persist the solver log to a file.

♻️ Changed

  • Presets: CONFIG.debug() and CONFIG.exploring() now set log_to_console=False (solver output is routed through the Python logger instead of native console output).
  • CONFIG.Solving.log_to_console now exclusively controls the solver's native console output. It no longer affects the tqdm progress bar (use the progress parameter instead).

🐛 Fixed

  • Clustering IO: cluster_weight is now preserved during NetCDF roundtrip for manually constructed clustered FlowSystems (i.e. FlowSystem(..., clusters=..., cluster_weight=...)). Previously, cluster_weight was silently dropped to None during save->reload->solve, causing incorrect objective values. Systems created via .transform.cluster() were not affected.

📦 Dependencies

  • tsam: Updated bounds to >= 3.1.2, < 4 (was >= 3.0.0, < 4, != 3.1.0). tsam 3.0.0 and 3.1.0 were yanked from PyPI. Dev pin updated from 3.0.0 to 3.1.2.

👷 Development

  • New test_math/ test suite: Comprehensive mathematical correctness tests with exact, hand-calculated assertions. Each test runs in 3 IO modes (solve, save→reload→solve, solve→save→reload) via the optimize fixture:
    • test_flow.py — flow bounds, merit order, relative min/max, on/off hours
    • test_flow_invest.py — investment sizing, fixed-size, optional invest, piecewise invest
    • test_flow_status.py — startup costs, switch-on/off constraints, status penalties
    • test_bus.py — bus balance, excess/shortage penalties
    • test_effects.py — effect aggregation, periodic/temporal effects, multi-effect objectives
    • test_components.py — SourceAndSink, converters, links, combined heat-and-power
    • test_conversion.py — linear converter balance, multi-input/output, efficiency
    • test_piecewise.py — piecewise-linear efficiency, segment selection
    • test_storage.py — charge/discharge, SOC tracking, final charge state, losses
    • test_multi_period.py — period weights, invest across periods
    • test_scenarios.py — scenario weights, scenario-independent flows
    • test_clustering.py — exact per-timestep flow_rates, effects, and charge_state in clustered systems (incl. non-equal cluster weights to cover IO roundtrip)
    • test_validation.py — plausibility checks and error messages

What's Changed

  • Add mathematical correctness test suite by @FBumann in #596
  • feat: Route solver output through Python logging by @FBumann in #606
  • chore(deps): update dependency xarray to v2026 by @renovate[bot] in #607
  • chore(deps): update dependency mkdocs-include-markdown-plugin to v7.2.1 by @renovate[bot] in #604
  • chore(deps): update dependency astral-sh/uv to v0.9.30 by @renovate[bot] in #503
  • chore(deps): update dependency mkdocs-git-revision-date-localized-plugin to v1.5.1 by @renovate[bot] in #603
  • chore(deps): update actions/cache action to v5 by @renovate[bot] in #568
  • fix(deps): update dependency pymdown-extensions to v10.20.1 by @renovate[bot] in #567
  • chore(deps): update astral-sh/setup-uv action to v7 by @renovate[bot] in #565
  • fix(deps): update dependency mkdocs-gen-files to v0.6.0 by @renovate[bot] in #504
  • Add combination tests for piecewise, status, investment & effects interactions by @FBumann in #608
  • chore(deps): update dependency astral-sh/uv to v0.10.9 by @renovate[bot] in #612
  • fix(deps): update dependency linopy to >=0.5.1, <0.7 by @renovate[bot] in #615
  • fix(deps): update dependency xarray to >=2024.2.0, <2026.3 by @renovate[bot] in #617
  • fix(deps): update tsam bounds after yanked releases by @FBumann in #622

Full Changelog: v6.0.2...v6.1.0