ESCOMP / CCPPStandardNames

Repository for community-accepted CCPP Standard Names and search tools
Other
3 stars 16 forks source link

Add CCPP metadata file standard name checking script #47

Closed nusbaume closed 9 months ago

nusbaume commented 10 months ago

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 and lib 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

nusbaume commented 10 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!

nusbaume commented 10 months ago

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.

nusbaume commented 9 months ago

Just FYI that I added a timestamp to the printed output as requested by @cacraigucar and @peverwhee.

nusbaume commented 9 months ago

@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.

dustinswales commented 9 months ago

@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.