microbiomedata / nmdc-schema

National Microbiome Data Collaborative (NMDC) unified data model
https://microbiomedata.github.io/nmdc-schema/
Creative Commons Zero v1.0 Universal
26 stars 8 forks source link

Allow `nmdc_data.py` consumer to specify which variant of schema they want to access #2091

Closed eecavanna closed 2 days ago

eecavanna commented 5 days ago

Summary of changes

Note: This summary was copied from here.

In this branch, I updated nmdc_data.py so that the fuctions that provide access to the JSON Schema version of the schema, allow the caller to specify which variant of the schema they want (they currently only support the default variant and the nmdc_materialized_patterns variant).

That will allow callers (such as the Runtime and the migration notebooks) to access the nmdc_materialized_patterns.schema.json JSON Schema (which they can use to perform data validation).

I also added doctests to all modified functions to demonstrate that they return values of the types I expect. The doctests can be run via $ poetry run python -m doctest nmdc_schema/nmdc_data.py (or, now, $ make test-python).


Note for reviewers


Note regarding schema freeze

github-actions[bot] commented 5 days ago

PR Preview Action v1.4.7 :---: :rocket: Deployed preview to https://microbiomedata.github.io/nmdc-schema/pr-preview/pr-2091/ on branch gh-pages at 2024-06-28 06:59 UTC

mslarae13 commented 2 days ago

Approved during berk-schema meeting check in. Only change, default should include/ require materialized patterns & you have the option to say no but we will split that out from this PR.