Merge feature/capgen into main 2021/08/12#391
Conversation
removed some unnecessary files from the build
modified: scripts/ccpp_prebuild_config_MusicBox.py
Kinetics
llpcarson
left a comment
There was a problem hiding this comment.
Merge looks good, approved.
Thanks for these comments. A few answers to your questions:
In summary, these PRs correct several inconsistencies i the metadata w.r.t. derived data types that |
gold2718
left a comment
There was a problem hiding this comment.
- I do not understand the changes to parse_checkers.py. The command:
git diff NCAR/feature/capgen dom/merge_feature_capgen_into_main_20210812 -- scripts/parse_tools/parse_checkers.py
shows more changes than the unit conversion from none to 1, however, these changes are not showing up in the diffs in this PR. Please explain.
Note: NCAR stands for github.com:/NCAR and dom stands for github.com/climbfuji (git command assumes that both remotes are loaded in a sandbox).
- convert_metadata.py is in feature/capgen but not in this PR. Did you decide to remove it?
- metavar.py does not match feature/capgen. Why?
| language: python | ||
|
|
||
| python: | ||
| - "2.7" |
There was a problem hiding this comment.
When do we get to drop Python 2 support?
There was a problem hiding this comment.
We don't use Python 2 anymore. I think this can be upgraded safely to Python 3 in a follow-up PR.
| # end if | ||
| self.__table_type = value | ||
| elif key == 'dependencies': | ||
| if value.lower() == "none" or value.strip() == '': |
There was a problem hiding this comment.
Why is a blank dependencies line an error here?
There was a problem hiding this comment.
capgen's metadata parser was creating a dependencies list that contained an item [ ' ' ] - this produced an error.
There was a problem hiding this comment.
That will not be happening once you merge #395 (and should not have been happening with the change you made).
| emsg += "already been declared as None" | ||
| self.__pobj.add_syntax_err(emsg) | ||
| else: | ||
| depends = [x.strip() for x in value.split(',') if x.strip()] |
There was a problem hiding this comment.
This change should be made in feature/capgen first, then merged into prebuild. Doing it this way will cause issues later on.
There was a problem hiding this comment.
If there is a PR to feature/capgen that I can pull in that is identical to this change - and nothing else - then I can pull it in, fix the merge conflict, assert that nothing has changed in the codebase, and don't have to rerun the tests. I don't see however why this change is causing a problem. It can be merged back from main to feature/capgen without issues.
There was a problem hiding this comment.
I don't see however why this change is causing a problem.
For one thing, it took me 20 times longer to process this PR due to this change and undocumented changes to the capgen code.
| # end if | ||
| if self.header_type == "ddt": | ||
| known_ddts.append(self.title) | ||
| # end if |
There was a problem hiding this comment.
There should be code here which is missing. What happened?
There was a problem hiding this comment.
I am not sure, there were several merge conflicts that I had to resolve. What is missing here?
There was a problem hiding this comment.
Do a diff against the feature/capgen version. After you merge #395, there should be no difference.
For this PR to be okay, there needs to be only one change between capgen code in feature/capgen and the code in this PR. Currently, that is not true.
| >>> VariableProperty('local_name', str, check_fn_in=check_local_name).valid_value('foo(bar)') | ||
| 'foo(bar)' | ||
| >>> VariableProperty('local_name', str, check_fn_in=check_local_name).valid_value('q(:,:,index_of_water_vapor_specific_humidity)') | ||
| 'q(:,:,index_of_water_vapor_specific_humidity)' |
There was a problem hiding this comment.
The variables below have been removed in feature/capgen. Why are they back?
There was a problem hiding this comment.
git seems to have added this code back in apparently when I did the merge
|
Fix parsing of dependencies
… into merge_feature_capgen_into_main_20210812
…ckers.py based on code review: remove old code in main, add missing code from feature/capgen
|
@gold2718 Thank you for your thorough code review. I would appreciate if you could keep these conversation at a professional level and refrain from comments like #391 (comment). Several of the changes that you complained about were made in main (or master at that time) in agreement and with your approval. They are not the result of a sloppy merge.
I made the following corrections based on your code review in commit 53aa9dc:
The fact that we are seeing more changes that slowed down your code review is not only because of the oversights listed in 4-8, but also because feature/capgen has not been updated from main (master) for years. I am unsure why this didn't happen. In all other projects I have been working, the maintainers of feature branches are usually keeping their branches up to date with the authoritative code to avoid exactly these kind of problems, especially when they are long-term developments like feature/capgen. But maybe there was a misunderstanding and we (DTC) should have created those PRs instead of you. You would still have had to review and accept them, though. After fixing the few merge problems described above (items 4, 5, 6, 8) and updating the PR description (item 7), the current PR must be merged as-is to keep the system capgen-metadata-parser + ccpp_prebuild working. We do not have the time and I do not see why I should be making the extra efforts to make these changes separately in feature/capgen first at this point, then merge them into my PR and fix the merge conflicts. It is natural in distributed development that changes are made in the same files in different branches, but as I said above they should have been merged back to feature/capgen immediately afterwards instead of years later. To avoid such problems in the future, I will create a follow-up PR to bring the changes/differences described above back to feature/capgen, and I strongly encourage that we do so on a regular basis going forward. Fortunately, after making all of the abovee changes, the auto-generated code is 100% identical to before, which means we do not have to rerun the regression tests on all nine platforms (we will rerun them on just one with two different compilers). |
Then, as part of the capgen unification project, this change should be made in the feature/capgen branch. Continually updating the main branch without contributing to the feature/capgen branch is slowing down the unification effort. |
If prebuild is using a feature not used by feature/capgen, that code should be moved to the prebuild codebase. |
Please move these changes to feature/capgen, then merge from there. |
No. We discussed this in the ccpp-framework meeting at that time, it was decided to generalize the false/true logic and I followed your recommendations at that time to do. This is an improvement for capgen that we agreed upon, which prebuild has adopted since then. I am not going to revert or move it. |
I agree, when are you going to do this? I argue that these changes should have been made first in feature/capgen in order to make progress towards capgen unification. |
I will create a PR with the active attribute changes, the true/false (valid vals) changes, and the documentation changes for feature/capgen, merge it, then formally update this PR (which must result in no changes to the code), then this should be ok. |
The PR is here: #396 - please merge and I will pull it into this PR. |
Immediately after #391 is merged. |
…e_metavar_doc_metadata_table Add active attribute and update true/false logic in metavar.py, update example metadata table in metadata_table.py
… into merge_feature_capgen_into_main_20210812
gold2718
left a comment
There was a problem hiding this comment.
Looks good now, thanks!
Update main with the latest development in
feature/capgen.Where incompatibilities exist between
capgenandccpp_prebuild, a workaround was added on theccpp_prebuildside. Exception: inparse_checkers.py, a temporary workaround is added to internally convert unitnoneto1to match the ccpp-physics/UFS/SCM units for dimensionless variables (none) with whatcapgenuses (1). A discussion has been started to eliminate those inconsistencies in the actual metadata (see ESCOMP/ESMStandardNames#18).Update 08/18/2021: one additional routine had to be added to
parse_checkers.pythat I forgot to mention previously:registered_fortran_ddt_names- this routine is required so thatccpp_prebuild.pycan get access to all the registered Fortran DDTs, because it utilizes capgen's metadata parser on a file-by-file basis.Associated PRs:
#391
earth-system-radiation/rte-rrtmgp#133
NCAR/ccpp-physics#718
NOAA-EMC/ufsatm#367
ufs-community/ufs-weather-model#745
For regression testing, see ufs-community/ufs-weather-model#745.