-
Notifications
You must be signed in to change notification settings - Fork 56
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
Adding ESP into MPhys wrapper #155
Conversation
Codecov Report
@@ Coverage Diff @@
## main #155 +/- ##
==========================================
- Coverage 63.90% 63.75% -0.15%
==========================================
Files 47 47
Lines 11757 11786 +29
==========================================
+ Hits 7513 7514 +1
- Misses 4244 4272 +28
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
The changes look good. One comment is on the initialization. Maybe we can modify the input arguments, have a single file input, and then determine the geo type based on the file extension? This would be a bit more foolproof. It's a bit tricky since I feel people use different extensions for the FFD files. VSP ones are all .vsp3 I think. I dont know the ESP extension.
That would work for ESP, they should all be
Is there a set of allowable extensions for FFDs we could look for? Or if |
This makes me a bit nervous because even though the extension identifies the file, it isn't technically necessary to read in the file (in any format, I believe). A user might write a file without an extension and then not understand why it doesn't load into pyGeo. Would having an option for "geo_type" be a reasonable compromise? |
Yeah, explicitly selecting geo_type also sounds good to me. Just a bit more explicit. Final decision is up to you, just raised that minor issue. I can approve the PR as is now as well. |
Sounds good to me, if it's okay with @hajdik. I like the idea of having a single option for file path / name and then specifying the geo type. Thanks for bringing this up! |
That sounds good to me, I can add that option in. |
On that note, could we also just make an “options” option instead of having the ESP, VSP, and FFD ones separate? |
I would prefer just using individual openmdao options for each option instead of one option taking in a dictionary. Is that what you meant? |
The options are different for each parametrization type, so I think we'd end up with a lot of options (and many combinations that are incompatible). I do like the idea of trying to map them directly without having a big dictionary as we have now, but I worry that might end up being many, many options listed in the wrapper? |
Now I see what you mean. so you are referring to the additional (optional) input arguments to initialize different classes? I am fine with adding that as a single option dictionary. |
Yes, exactly. We should combine these:
|
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.
Thanks for the fixes.
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.
Just some minor comments on the code.
Are you sure you just want to pass in the options for the different kinds of parametrizations as a dict (?), without any check before initializing the class? I assume you can rely on error messages when __init__
is run, but could be confusing in the long term imho
Regardless of if they are passed as dicts corresponding to the parametrization or as a general dict, there is no actual check for the options lining up in MPhys. So, the user could make the mistake regardless. A proper fix for this would be to check in the Edit: this opens a fairly large can of worms as we really should be doing this for all our |
Agreed, and as I mentioned the error messages should be already clear enough for the user |
I think that should be a separate PR with wider discussion on the DVGeo modules themselves and this can stay as just touching the MPhys wrapper with the bugfixes for VSP + adding in ESP. |
I think there is a chance that a user specifies an option that is invalid and does not receive an error message. But, this could happen whenever instantiating pyGeo so this MPhys version is not any worse than before. I certainly agree with you that it is an issue we should address (though not on this PR...). |
This is minor, but while we are making backwards incompatible changes: can we remove |
Purpose
@bernardopacini and I added functions needed for
DVGeoESP
into the MPhys wrapper. Checks were also added to ensure the correct DVGeo type has been instantiated when using wrapper functions that are only for specific types, which fixes theDVGeoVSP
part of the wrapper because the previous addition of child FFD functions assumed all DVGeos can use child FFDs.Expected time until merged
1 week unless we find something else this breaks
Type of change
Testing
This works with DAFoam and ADflow ESP-MPhys scripts. If I have time I'll add 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