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

Updating catalog validation instructions #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions catalogbuilder/scripts/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ def main(json_path,json_template_path,test_failure):

""" This test ensures catalogs generated by the Catalog Builder tool are minimally valid. This means a few things: the generated catalog JSON file reflects the template it was generated with, the catalog CSV has atleast one row of values (not headers), and each required column exists without any empty values. If a test case is broken or expected to fail, the --test-failure/-tf flag can be used. This flag will simply print errors instead of doing a sys.exit.


USAGE:

test_catalog.py <JSON_PATH> - Checks catalog for consistency with default template
or
test_catalog.py <JSON_PATH> <JSON_TEMPLATE_PATH> - Checks catalog for consistency with custom template

JSON_PATH: Path to generated schema to be tested

JSON_TEMPLATE_PATH: Path of schema template. Without a given path, cats/gfdl_template.json will be used for comparison """
Expand Down
16 changes: 16 additions & 0 deletions doc/generation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,19 @@ Ex. gen_intake_gfdl.py /archive/Some.User/input-path ./output_path
- --slow - Activates slow mode which retrieves standard_name (or long_name) where possible. **"Standard_name" must be in your output_path_template**
- --i - Optional method for passing input path
- --o - Optional method for passing output path

Validating Generated Catalogs
_____________________________

This test ensures catalogs generated by the Catalog Builder tool are minimally valid. This means a few things: the generated catalog JSON file reflects the template it was generated with, the catalog CSV has atleast one row of values (not headers), and each required column exists without any empty values. If a test case is broken or expected to fail, the --test-failure/-tf flag can be used. This flag will simply print errors instead of doing a sys.exit.


USAGE:

test_catalog.py <JSON_PATH> - Checks catalog for consistency with default template
or
test_catalog.py <JSON_PATH> <JSON_TEMPLATE_PATH> - Checks catalog for consistency with custom template

JSON_PATH: Path to generated schema to be tested

JSON_TEMPLATE_PATH: Path of schema template. Without a given path, cats/gfdl_template.json will be used for comparison
Loading