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

Fix test for earlier SNOPT versions #370

Merged
merged 5 commits into from
Dec 13, 2023
Merged

Fix test for earlier SNOPT versions #370

merged 5 commits into from
Dec 13, 2023

Conversation

ewu63
Copy link
Collaborator

@ewu63 ewu63 commented Dec 6, 2023

Purpose

Closes #369.

Expected time until merged

ASAP.

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

Checklist

  • I have run flake8 and black to make sure the Python code adheres to PEP-8 and is consistently formatted
  • I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@ewu63 ewu63 requested a review from a team as a code owner December 6, 2023 01:53
@ewu63 ewu63 requested review from lamkina and sseraj December 6, 2023 01:53
Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (75e6479) 73.36% compared to head (5bedf92) 73.36%.

Files Patch % Lines
pyoptsparse/pySNOPT/pySNOPT.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #370      +/-   ##
==========================================
- Coverage   73.36%   73.36%   -0.01%     
==========================================
  Files          22       22              
  Lines        3312     3315       +3     
==========================================
+ Hits         2430     2432       +2     
- Misses        882      883       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ewu63
Copy link
Collaborator Author

ewu63 commented Dec 6, 2023

Can someone with access test whether the offending test passes with SNOPT 7.7.5? If so then I'd propose bumping the SNOPT version rather than trying to patch very outdated SNOPT versions within pySNOPT. CC @eirikurj @eytanadler

@eirikurj
Copy link
Contributor

eirikurj commented Dec 7, 2023

For completeness, I tried 7.7.5 and tests still fail. Is that however not expected since sol.objectives is now being overwritten with fStar, which is the buggy zero obj value returned from SNOPT?

@ewu63
Copy link
Collaborator Author

ewu63 commented Dec 7, 2023

Hm I had thought that maybe 7.7.5 fixed the bug, but perhaps not. A few options:

  1. add a version check in pySNOPT to not overwrite sol.objectives values for versions 7.7 below 7.7.7.
  2. hack or skip the tests for buggy SNOPT versions

I am in favour of the first option since with the changes in #364, buggy SNOPT optimizations essentially lose the optimal objective value, while previously you can at least get the last queried value via sol.objectives which is often times close. I'm going to push a patch following 1) but happy to hear other opinions.

@ewu63
Copy link
Collaborator Author

ewu63 commented Dec 8, 2023

Right, I forgot to un-scale the obj values. Thanks, LGTM

@eirikurj eirikurj mentioned this pull request Dec 12, 2023
13 tasks
Copy link
Contributor

@lamkina lamkina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ewu63
Copy link
Collaborator Author

ewu63 commented Dec 13, 2023

@eirikurj or @sseraj let's merge this so we don't fail the nightly build?

@eirikurj
Copy link
Contributor

Yeah, tests have been failing for a while. @sseraj do you have time to review this or anyone from @mdolab/pyoptsparse_maintainers? If not, I will merge at end of week.

@sseraj sseraj merged commit 82bbb68 into main Dec 13, 2023
13 checks passed
@sseraj sseraj deleted the bugfix/snopt-test-fstar branch December 13, 2023 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SNOPT tests failing on stable images
4 participants