-
Notifications
You must be signed in to change notification settings - Fork 118
IPOPT wrapper improvement to get more iteration information #459
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #459 +/- ##
==========================================
- Coverage 86.72% 86.70% -0.02%
==========================================
Files 24 24
Lines 3435 3460 +25
==========================================
+ Hits 2979 3000 +21
- Misses 456 460 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@kanekosh looks like the tests are failing on I will take a look at the PR in the next few days, but this sounds like a welcome improvement! |
Thanks, I added a check on the IPOPT version so this is fixed now. |
tests/test_hs015.py
Outdated
| optOptions = self.optOptions.pop(self.optName, None) | ||
| store_vars = ["alg_mod", "d_norm", "regularization_size", "ls_trials"] | ||
| # check IPOPT version and add more variables to save_major_iteration_variables if IPOPT>=3.14 | ||
| ipopt_314 = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we do not need to support IPOPT<3.14 in tests, because 3.14.0 came out in 2021. We can just make sure we're installing sufficiently new versions of IPOPT in tests (I guess in Docker which we already do, and maybe we can pin in conda-forge)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but our stable Docker image still uses IPOPT 3.13.4, so we'll need to update that on the Docker side for the tests here to pass. I'll bring this up in the Docker repo.
tests/test_hs015.py
Outdated
| from parameterized import parameterized | ||
|
|
||
| try: | ||
| # External modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly we can get rid of this import
|
Also feel free to bump the patch version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fair to drop support for IPOPT 3.13 at this point, although that might count as a downstream breaking change?
| if self.name == "SNOPT": | ||
| hist["isMajor"] = False # this will be updated in _snstop if it is major | ||
| # Save information about major iteration counting (only matters for SNOPT and IPOPT). | ||
| if self.name in ["SNOPT", "IPOPT"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a curiosity for the moment.. do you think intermediate could be used in the same way _snstop is used? #420 is stalled now but I wonder if we could extend similar features to IPOPT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, eventually we can reorganize and refactor that part of the logic, it's a fairly common feature for optimizers to provide a per-iteration callback functionality.
|
I opened a PR to update the IPOPT version in our stable docker image (https://github.com/mdolab/docker/pull/298), so once that's merged I'll remove the IPOPT 3.13 support from this PR. |
Purpose
intermediatecallbackExpected time until merged
No rush
Type of change
Testing
Checklist
ruff checkandruff formatto make sure the Python code adheres to PEP-8 and is consistently formattedfprettifyor C/C++ code withclang-formatas applicable