-
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.27% 86.27% -0.01%
==========================================
Files 24 24
Lines 3432 3461 +29
==========================================
+ Hits 2961 2986 +25
- Misses 471 475 +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. |
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.
doc/optimizers/IPOPT_options.yaml
Outdated
In addition, a set of default parameters are saved to the history file and cannot be changed. These are | ||
- ``feasibility``: primal infeasibility (called ``inf_pr`` in 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.
I kind of want to keep this Python wrapper "thin", and not introduce new names for parameters that are already called certain things in the IPOPT community. Therefore I think it's probably best if we keep the same IPOPT names here, even though many have analogues with SNOPT. It will make some postprocessing annoying across optimizers, but they will be apple to oranges comparisons since they will use different scaling etc. to compute these parameters.
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.
Good point, I updated the variable names to follow what IPOPT/cyIPOPT uses.
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 |
Purpose
intermediate
callbackExpected time until merged
No rush
Type of change
Testing
Checklist
ruff check
andruff format
to make sure the Python code adheres to PEP-8 and is consistently formattedfprettify
or C/C++ code withclang-format
as applicable