-
Notifications
You must be signed in to change notification settings - Fork 109
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
Bugfix for optimal objective value #364
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #364 +/- ##
===========================================
- Coverage 73.38% 61.65% -11.74%
===========================================
Files 22 22
Lines 3307 3312 +5
===========================================
- Hits 2427 2042 -385
- Misses 880 1270 +390 ☔ View full report in Codecov by Sentry. |
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.
This looks good to me.
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.
Looks good, just one minor comment
pyoptsparse/pyOpt_solution.py
Outdated
for var in self.variables[dvGroup]: | ||
var.value = xopt[i] | ||
i += 1 | ||
i = 0 |
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.
Is this line necessary?
bump @lamkina |
Purpose
Previously,
sol.fStar
is taken to be the optimal objective value, butsol.objectives[obj_name].value
is the objective value of the last queried point, which is not guaranteed to match. This is now fixed, even though this is ambiguous and undocumented.Note that the constraint values are still the last queried values, since the constraint value at the optimum is not returned by the optimizer and we do not want to query the constraints just to get this value. So they are left as the last value.
Expected time until merged
1 week
Type of change
Testing
I added a test
Checklist
flake8
andblack
to make sure the Python code adheres to PEP-8 and is consistently formattedfprettify
or C/C++ code withclang-format
as applicable