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

Support latest OpenMDAO version #70

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Support latest OpenMDAO version #70

wants to merge 8 commits into from

Conversation

kanekosh
Copy link
Contributor

@kanekosh kanekosh commented Feb 28, 2025

Purpose

This PR resolves issue #65 which has been restricting OpenMDAO version to <=3.30.0. Now with this PR, OpenConcept should work with more recent OM versions (latest is 3.37.0 at this moment)

As explained in #65, OpenConcept uses _setup_procs (a private method in OM) in PhaseGroup and IntegratorGroup. The function signature for _setup_procs changed in OpenMDAO 3.31.

  • I got rid of _setup_procs in PhaseGroup. The _setup_procs was used to pass down the duration variable name and num_nodes to the groups below it via prob_meta. Actually IntegratorGroup is the only child group of the PhaseGroup that refers to this information, and we don't need to use prob_meta to pass down this info. To do so, this PR adds num_nodes option to IntegratorGroup and drop Dymos/OpenConcept check (we have some old Dymos-related code but these are not really working and supported, so I believe we can just drop Dymos checks).
  • I had to keep _setup_procs in IntegratorGroup, though. IntegratorGroup is a parent class and is always inherited by a user-defined class (typically AircraftModel). In IntegratorGroup, we call _setup_procs to automatically add ode_integ subsystem to this group, which will be later used with other user-defined subsystems in AircraftModel. I couldn't find a way to do this without using an OM private method. But good news is, now, the _setup_procs doesn't need to access the arguments of this method, so we can use *args and it works regardless of the number of arguments (which differs depending on OM version). Hence it works with both old and new OM versions.

Note

This is not related to this fix, but I temporarily set OAS version requirement to 2.7.1 because OAS had a few changes since then that which changed the reference values of OAS-related tests. (Builds has been failing since last summer for this reason). I'll update the OAS reference values in a separate PR.

Also now we support new OM versions, so we should also update OpenConcept to support numpy 2. I'll work on it in another PR.

Type of change

What types of change is it?
Select the appropriate type(s) that describe this PR

  • Bugfix (non-breaking change which fixes an issue)
  • Refactoring (no functional changes, no API changes)

Test

I deleted one of the tests on IntegratorGroup. This test has been checking if the IntegratorGroup raises an error as expected if it was used stand-alone (but not under PhaseGroup). Now I had to delete this check from IntegratorGroup to not rely on prob_meta. (In fact, I think this IntegratorGroup could be used stand-alone, although that doesn't make sense).

Checklist

Put an x in the boxes that apply.

  • 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

@kanekosh kanekosh marked this pull request as ready for review February 28, 2025 19:14
@kanekosh kanekosh requested a review from a team as a code owner February 28, 2025 19:14
@kanekosh kanekosh marked this pull request as draft February 28, 2025 19:20
Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.06%. Comparing base (1032ad4) to head (f143cc1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
- Coverage   82.08%   82.06%   -0.02%     
==========================================
  Files         103      103              
  Lines       10717    10706      -11     
==========================================
- Hits         8797     8786      -11     
  Misses       1920     1920              

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

@kanekosh kanekosh marked this pull request as ready for review February 28, 2025 20:55
@kanekosh
Copy link
Contributor Author

@eytanadler Tagging you just in case, but feel free to unsubscribe

@eytanadler
Copy link
Collaborator

Thanks so much for coming back to this and fixing it @kanekosh!

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.

2 participants