-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fix #234 #244
Fix #234 #244
Conversation
This works for |
how does it fail? A bool in python is nothing but an integer. |
|
Same with
|
Probably best to add a unit test that at least ensures these errors don't occur (you don't have to check whether the correct things are shown on stdout). |
Also, the default for minimize_ipopt should show the least amount of info from IPOPT (ideally no info). |
The default of 5 is taken from the official ipopt site https://coin-or.github.io/Ipopt/OPTIONS.html#OPT_print_level I tested the code on my side. And the results are correct. >>> options = {'print_level' : True}
>>> convert_to_bytes(options)
>>> replace_option(options, b'disp',b'print_level')
>>> int(options.get(b'print_level', 5))
1 >>> options = {'disp' : True}
>>> convert_to_bytes(options)
>>> replace_option(options, b'disp',b'print_level')
>>> int(options.get(b'print_level', 5))
1 >>> options = {b'print_level' : True}
>>> convert_to_bytes(options)
>>> replace_option(options, b'disp',b'print_level')
>>> int(options.get(b'print_level', 5))
1 >>> options = {b'disp' : True}
>>> convert_to_bytes(options)
>>> replace_option(options, b'disp',b'print_level')
>>> int(options.get(b'print_level', 5))
1 |
That's fine, but that is 1) not what we currently have and 2) not what is desired for the
Did you test with the |
I may be picking up the old code, double checking. |
cloned my PR, ran pytest:
|
Ok, I rechecked an If you change the default to display no output, I'll merge. Thanks. |
Great. Thanks for the fix. |
Hotfix for
print_level
#234 to allow integer other than 0 or 1.Bools are also converted this way.
Commit mistakenly references #239. No idea how to fix this after the fact.