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

Add dvs as real to optimization problem #236

Merged
merged 4 commits into from
Feb 2, 2024
Merged

Conversation

eirikurj
Copy link
Contributor

Purpose

DVs should be real before adding to pyOptSparse, otherwise implicit casting might fail and hang the optimization process, as happens with SLSQP described in mdolab/MACH-Aero#96. This was initially caused by a change in pyOptSparse (see this PR and comment).

This PR addresses this issue. Additionally, made a small refactor to reduce multiple raise Error calls.

Ideally, DVGeo DVs should not be allocated by default as complex, but cast as needed. This is however a more fundamental change. This PR is intended to get SLSQP working again quickly, as it has been broken for months, and allow SLSQP MACH-Aero integration tests to be added.

Expected time until merged

ASAP as MACH-Aero and SLSQP do not work past pyOptSparse 2.10

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

Run MACH-Aero tests

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

@eirikurj eirikurj requested a review from a team as a code owner January 31, 2024 15:54
@eirikurj eirikurj requested review from sseraj and ArshSaja January 31, 2024 15:54
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

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

Comparison is base (86caa3b) 65.30% compared to head (8e8cf55) 65.32%.

Files Patch % Lines
pygeo/parameterization/DVGeo.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
+ Coverage   65.30%   65.32%   +0.02%     
==========================================
  Files          47       47              
  Lines       12122    12121       -1     
==========================================
+ Hits         7916     7918       +2     
+ Misses       4206     4203       -3     

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

Copy link
Contributor

@marcomangano marcomangano left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this. I agree that we should revisit the way DVs are allocated in pyGeo at a later stage.

Copy link
Collaborator

@sseraj sseraj left a comment

Choose a reason for hiding this comment

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

I checked that the MACH-Aero examples now run with SLSQP. Thanks!

@sseraj sseraj merged commit 7043a74 into mdolab:main Feb 2, 2024
12 checks passed
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.

3 participants