-
Notifications
You must be signed in to change notification settings - Fork 64
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
Bug fix in metavar.py: optional var props with a default value need t… #508
Bug fix in metavar.py: optional var props with a default value need t… #508
Conversation
…o return the default value when variable doesn't have a value
There is a problem with this bug fix! From cld_suite_cap.F90
From test_host_ccpp_cap.F90:
Both of these changes ae wrong! This is one of the issues I was mentioning yesterday with the problem of assuming that a missing optional property should be treated the same as the default value for that property. As for the description above, perhaps you should change |
I figured out that it's because now the "polymorphic" optional var prop is also returning |
…se' for optional var prop 'polymorphic'
@gold2718 I fixed it, turned out to be a really simple bug in the default value definition of the optional var prop |
Ow, ow OW (I have to learn to slap my forehead with less force)! |
I've never used this and I am running out of time for this week, but I'll try to get to it as soon as I can. Yes, I noted that there are quite some differences in the auto-generated files (order in the Fortran code etc) and found that concerning as well. |
While I'm not concerned by the generated code changes, we could probably fix this by sorting dictionary lists when writing (use statements, variable declarations are two I noticed). @mkavulich, Do you have a way to test |
@gold2718 Good suggestion, unit tests for that script are long overdue. I'll work on it this week. |
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.
It should probably be documented somewhere that this will change which properties show up in places such as the datatable.xml file.
@mkavulich Did you make any progress with CI'ing the ccpp_track_variables.py script? (If not, then I think we should merge this and move on. We could add that test at a later time) |
I suggest opening an issue to address ccpp_track_variables.py checking and CI. Then this can be merged. It might be nice to also clean up the PR description with the confusion about why the tests failed at first (the code change in this PR turned a |
Sorry, I didn't realize I was holding up this PR. You can go ahead and merge, my plan was to implement that test in the main branch anyway. |
I updated the PR description to clean it up and add a note about the properties, as requested. I'll go ahead and merge. Thanks for your feedback and reviews. |
Fix return value for optional variable properties that are not set by the variable and that have a default value (instead of a default function). Credits go to @gold2718 for suggesting this bug fix.
See #509 for a description.
Note due to the updates in this PR, there is a change in which properties show up in places like the
datatable.xml
file. This triggered a desire to add a CI test for theccpp_track_variables.py
script (see #511).User interface changes?: No
Fixes #509
Testing:
metavar.py
cd test && ./run_fortran_tests.sh
on my macOS and all tests passed (noting thatvar_action_test
is skipped on thefeature/capgen
branch because of the failing unit conversion tests)metavar.py
as described in the issue