WCRP-CORDEX / cordex-cmip6-cv

Controlled Vocabulary (CV) for use in CORDEX
BSD 3-Clause "New" or "Revised" License
1 stars 7 forks source link

Generate json schema out of CV #188

Closed huard closed 1 month ago

huard commented 1 month ago

This script generates a JSON schema out of the CVs.

If I got it right, it should be run automatically by the CI Actions, so the schema will remain in sync with the CV.

One thing that's missing is some kind of versioning. The schema will potentially change with each PR, so it'd be good to have a tag that gets bumped each time the schema changes.

Disclaimer, I'm a schema noob.

larsbuntemeyer commented 1 month ago

Thanks @huard , would be great to have. I tried to wrap my head around schema validation some time ago for CORDEX-CMIP6 (https://github.com/orgs/WCRP-CORDEX/discussions/4) but didn't really know about JSON schema (also a noob!). @sol1105 is working on a compliance checker plugin which is supposed to read in the CV in the current cmor table format and it works well for NetCDF files.

Do you think, we should move the script content to the cordex_cv package? It's just easier for me to maintain!

Concerning the versioning: This is really unclear yet since we didnt' really had like a proper initial version yet and we didn't want to tag each update.

huard commented 1 month ago

Sure, I can move the logic to cv.py.

I understand, but I think it would be useful at some point to tag the main branch every time the CV changes. There are actions to tag PRs according to rules (https://github.com/marketplace/actions/automate-pull-request-generation-and-tagging-for-releases-using-tagpr). This tag could then be used to uniquely identify the schema ($ID).