Closed nusbaume closed 9 months ago
@cacraigucar I took you off the reviewer list because it's basically all python code, but if you would still like to review this PR then just let me know. Thanks!
Apologies for the sudden flurry of commits, but of course I found a bug as soon as I opened the PR. It should be resolved now, and so this PR is ready to review whenever.
Just FYI that I added a timestamp to the printed output as requested by @cacraigucar and @peverwhee.
@dustinswales Apologies for missing your post! Yes, I was assuming this would be a tool one could apply to CCPP metadata files in external repos that contain such files (e.g. NCAR/ccpp-physics
or NCAR/atmospheric_physics
).
I certainly think that long-term it would be good to implement something like this script in a CI test to ensure that all standard names listed in a new metadata file are in the dictionary. However, I haven't really pushed for it at this stage simply because I believe a lot of physics schemes don't have fully dictionary-compliant standard names, and that it will probably take some work before a critical mass of them do.
@nusbaume No worries (I forgot that I made a comment...) Yeah, we don't need to add this to our actions right away, but since you created it, we should put it to use at somepoint.
This Pull Request adds a new
meta_stdname_check.py
script that takes a path either to a metadata file or a directory and attempts to parse all of the found metadata files to see if there are any standard names that do not exist in the provided standard names dictionary, and then attempts to print the list to stdout in a hopefully easy-to-read way.Along with this, I moved all of the other python files into a new
tools
andlib
directory, to try and reduce the flatness of the repo. This also required me to modify some of these scripts, as well as the Github Action workflow file, to make sure everything still works the way it is expected to.Finally, I should note that I manually tested all of the scripts, but haven't implemented any sort of formal testing of the scripts themselves. If this is desired then please let me know.
Fixes #41