Skip to content

v6.1.0rc0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 12 Feb 10:58
· 51 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.

👷 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

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