Restore optnames_aero used by the stability evaluations - #2903
Closed
ManasBagul23 wants to merge 1 commit into
Closed
ManasBagul23 wants to merge 1 commit into
ManasBagul23 wants to merge 1 commit into
Conversation
optnames_aero was removed from SU2.io when the history field mapping was introduced, but stability() in eval/functions.py and eval/gradients.py still use it to find the base coefficient of the D_*_D_ALPHA objectives. Selecting any of those objectives failed with AttributeError. Rebuild the list from the coefficient entries of the history map, which gives one match for every stability objective.
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues were identified.
Pull request overview
Restores SU2.io.optnames_aero so stability evaluations can resolve base aerodynamic coefficients.
Changes:
- Rebuilds aerodynamic objective names from coefficient entries.
- Restores stability evaluation compatibility.
File summaries
| File | Description |
|---|---|
SU2_PY/SU2/io/tools.py |
Defines optnames_aero from historyOutFields. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
optnames_aerowas removed fromSU2.iowhen the history field mapping was introduced (39dbebc), butstability()inSU2_PY/SU2/eval/functions.pyandSU2_PY/SU2/eval/gradients.pystill use it to find the base coefficient of theD_*_D_ALPHAobjectives. Choosing any of those objectives fails with:This PR defines
optnames_aeroagain inSU2_PY/SU2/io/tools.py, built from theCOEFFICIENTentries of the history map. Every entry ofoptnames_stabmatches exactly one of them (D_LIFT_D_ALPHA->LIFT, ...,D_MOMENT_Z_D_ALPHA->MOMENT_Z).Tested by calling both
stability()functions with the solver runs mocked:gradients.stabilitypicks the right base name for all six objectives, andfunctions.stabilityreturns the expected finite differences.Related Work
Closes #2913.
PR Checklist
pre-commit run --allto format old commits.