Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disturbing output when importing linopy on windows without cbc/glpk as available_solvers #85

Closed
jankaeh opened this issue Jan 11, 2023 · 2 comments

Comments

@jankaeh
Copy link
Contributor

jankaeh commented Jan 11, 2023

In solvers.py the lines 30&33 create unwanted(?) output:

if sub.run([which, "glpsol"], stdout=sub.DEVNULL).returncode == 0:
available_solvers.append("glpk")

if sub.run([which, "cbc"], stdout=sub.DEVNULL).returncode == 0:
available_solvers.append("cbc")

Everytime I import linopy on windows without cbc/glpk available, I get this twice:
INFORMATION: Es konnten keine Dateien mit dem angegebenen
Muster gefunden werden.

adding "stderr=sub.STDOUT" like so removes this output:
if sub.run([which, "glpsol"], stdout=sub.DEVNULL, stderr=sub.STDOUT).returncode == 0:
available_solvers.append("glpk")

I am not sure if this is what you want?

@FabianHofmann
Copy link
Collaborator

I see, but the import still works right? Seems that windows prints out this extra information. I am not familiar with windows machines, would be nice to suppress this information.

@jankaeh
Copy link
Contributor Author

jankaeh commented Jan 11, 2023

Yes the import still works. I just was confused because I had no idea where that information came from. If the changes do not affect the expected behaviour on linux, it'd be nice to supress the info.

@jankaeh jankaeh closed this as completed Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants