v6.1.0rc0
Pre-release
Pre-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_logoption routes solver output (HiGHS, Gurobi, etc.) through theflixopt.solverPython 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 byCONFIG.debug(),CONFIG.exploring(),CONFIG.production(), andCONFIG.notebook()presets. (#606) progressparameter:solve(),optimize(), androlling_horizon()now accept aprogressparameter (defaultTrue) to control the tqdm progress bar independently of CONFIG settings.log_fnparameter:solve()now accepts alog_fnparameter to persist the solver log to a file.
♻️ Changed
- Presets:
CONFIG.debug()andCONFIG.exploring()now setlog_to_console=False(solver output is routed through the Python logger instead of native console output). CONFIG.Solving.log_to_consolenow exclusively controls the solver's native console output. It no longer affects the tqdm progress bar (use theprogressparameter instead).
🐛 Fixed
- Clustering IO:
cluster_weightis now preserved during NetCDF roundtrip for manually constructed clustered FlowSystems (i.e.FlowSystem(..., clusters=..., cluster_weight=...)). Previously,cluster_weightwas silently dropped toNoneduringsave->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 theoptimizefixture:test_flow.py— flow bounds, merit order, relative min/max, on/off hourstest_flow_invest.py— investment sizing, fixed-size, optional invest, piecewise investtest_flow_status.py— startup costs, switch-on/off constraints, status penaltiestest_bus.py— bus balance, excess/shortage penaltiestest_effects.py— effect aggregation, periodic/temporal effects, multi-effect objectivestest_components.py— SourceAndSink, converters, links, combined heat-and-powertest_conversion.py— linear converter balance, multi-input/output, efficiencytest_piecewise.py— piecewise-linear efficiency, segment selectiontest_storage.py— charge/discharge, SOC tracking, final charge state, lossestest_multi_period.py— period weights, invest across periodstest_scenarios.py— scenario weights, scenario-independent flowstest_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