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

print_level doesn't seem to work correctly for minimize_ipopt #234

Closed
AlexanderThebeltQC opened this issue Oct 6, 2023 · 3 comments
Closed

Comments

@AlexanderThebeltQC
Copy link

When I give options = {"disp": 5} to minimize_ipopt it always ends up using {b"print_level": 0}, meaning no output is printed. I believe the problem is here in the code. Given that options is a dict it will always end up in the else case. Maybe option.get() is more suitable here? And it would be great if we can allow for display levels greater than 1. Apologies if I'm missing something or using the interface wrong!

@Robbybp
Copy link
Contributor

Robbybp commented Oct 24, 2023

This looks like a bug to me, and your proposed fix sounds good. I see no reason not to allow print_level > 1 in the SciPy interface. PRs welcome!

@MarkusZimmerDLR
Copy link
Contributor

MarkusZimmerDLR commented Nov 29, 2023

The linked PR is not making any progress and is mixing issues which are not related.

I suggest creating a simple hotfix for this, changing

if getattr(options, 'print_level', False) is True:
    options[b'print_level'] = 1

to

options[b'print_level'] = int(options.get(b'print_level', 5) )

@AlexanderThebeltQC
Copy link
Author

Sounds good! I was under the impression that this would get fixed in the other PR but I have a bit of time to submit something tomorrow. Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants