You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have confirmed this bug exists on the lastest release of Linopy.
I have confirmed this bug exists on the current master branch of Linopy.
Issue Description
Note
I've debugged this issue with AI (ChatGPT) and had it write a bug report which I mostly rewrote in my own words below.
I've encountered this bug (or, perhaps, an inconsistency in behaviour across solvers) while running a PyPSA-Eur model with HiGHS and then with Mosek. I like to watch the progress of the solve in order to assess the speed of convergence and diagnose potential pathologies early on, but I noticed that while HiGHS logs both to the console and the log file in parallel, Mosek only streams to the log file.
The problem seems to stem from the difference in how log_fn is handled. The Mosek backend currently does:
Therefore, when log_fn is given, the Mosek log stream is connected exclusively to the file and no stdout stream is attached. By contrast, the HiGHS backend sets its log_file option without disabling console logging.
Version Checks (indicate both or one)
I have confirmed this bug exists on the lastest release of Linopy.
I have confirmed this bug exists on the current
masterbranch of Linopy.Issue Description
Note
I've debugged this issue with AI (ChatGPT) and had it write a bug report which I mostly rewrote in my own words below.
I've encountered this bug (or, perhaps, an inconsistency in behaviour across solvers) while running a PyPSA-Eur model with HiGHS and then with Mosek. I like to watch the progress of the solve in order to assess the speed of convergence and diagnose potential pathologies early on, but I noticed that while HiGHS logs both to the console and the log file in parallel, Mosek only streams to the log file.
The problem seems to stem from the difference in how
log_fnis handled. The Mosek backend currently does:Therefore, when
log_fnis given, the Mosek log stream is connected exclusively to the file and no stdout stream is attached. By contrast, the HiGHS backend sets itslog_fileoption without disabling console logging.Reproducible Example
Expected Behavior
Setting
log_fnshould not disable Mosek's progress logging in the console.Mosek should behave consistently with HiGHS: solver output should be displayed in the console while also being written to
log_fn.Installed Versions
Details
Bottleneck==1.6.0 click==8.5.0 cloudpickle==3.1.2 dask==2026.8.0 deprecation==2.1.0 fsspec==2026.7.0 linopy==0.9.1 locket==1.0.0 Mosek==11.2.3 numexpr==2.14.2 numpy==2.5.3 packaging==26.3 pandas==3.0.5 partd==1.4.2 polars==1.44.1 polars-runtime-32==1.44.1 python-dateutil==2.9.0.post0 PyYAML==6.0.3 scipy==1.18.1 six==1.17.0 toolz==1.1.0 tqdm==4.70.0 xarray==2026.7.0