Skip to content
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

add cfchecker run script #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ssuttles-usgs
Copy link
Collaborator

Add script to run cf compliance checker utility in stglib.core.utils.py as standalone. File to check is passed as argument to the run script.

usage: runcfchecker.py [-h] ncname

@dnowacki-usgs
Copy link
Member

Is the main advantage of this run script over just running compliance-checker at the command-line that it automatically determines which version of CF the file uses?

@ssuttles-usgs
Copy link
Collaborator Author

Honestly, at the time I did not know how to run the compliance-checker from the command line and decided it would be convenient to have a run script in the stglib style to run it on any file as a standalone. After your comment I did figure out how to run it from the command line, but I still see the utility in this run script as it leverages the code in stglib and metadata in the file to format the command properly and run the checker. I think it will also be useful to run a batch of files in a folder. e.g in windows can use a .bat to run all *.nc files in a folder with this simple code:

for %%f in (*.nc) do (
echo %%~nf
python c:/users/ssuttles/git/stglib/scripts/runcfchecker.py "%%~nf.nc"
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants