diff --git a/config/cmip5.yaml b/config/cmip5.yaml index 94fbfa3..86c02b8 100644 --- a/config/cmip5.yaml +++ b/config/cmip5.yaml @@ -4,10 +4,10 @@ translator: Cmip5Translator sources: - - metadata_yaml: /g/data/tm70/intake/metadata/cmip5_al33/metadata.yaml + - metadata_yaml: /g/data/xp65/admin/intake/metadata/cmip5_al33/metadata.yaml path: - - /g/data/dk92/catalog/v2/esm/cmip5-al33/catalog.json + - /g/data/al33/catalog/v2/esm/catalog.json - - metadata_yaml: /g/data/tm70/intake/metadata/cmip5_rr3/metadata.yaml + - metadata_yaml: /g/data/xp65/admin/intake/metadata/cmip5_rr3/metadata.yaml path: - - /g/data/dk92/catalog/v2/esm/cmip5-rr3/catalog.json + - /g/data/rr3/catalog/v2/esm/catalog.json diff --git a/config/cmip6.yaml b/config/cmip6.yaml index cea083a..d50b021 100644 --- a/config/cmip6.yaml +++ b/config/cmip6.yaml @@ -4,10 +4,10 @@ translator: Cmip6Translator sources: - - metadata_yaml: /g/data/tm70/intake/metadata/cmip6_fs38/metadata.yaml + - metadata_yaml: /g/data/xp65/admin/intake/metadata/cmip6_fs38/metadata.yaml path: - - /g/data/dk92/catalog/v2/esm/cmip6-fs38/catalog.json + - /g/data/fs38/catalog/v2/esm/catalog.json - - metadata_yaml: /g/data/tm70/intake/metadata/cmip6_oi10/metadata.yaml + - metadata_yaml: /g/data/xp65/admin/intake/metadata/cmip6_oi10/metadata.yaml path: - - /g/data/dk92/catalog/v2/esm/cmip6-oi10/catalog.json + - /g/data/oi10/catalog/v2/esm/catalog.json diff --git a/config/experiments/cmip5-al33/metadata.yaml b/config/experiments/cmip5-al33/metadata.yaml new file mode 100644 index 0000000..15b4ccb --- /dev/null +++ b/config/experiments/cmip5-al33/metadata.yaml @@ -0,0 +1,52 @@ +# Metadata recovered 2024-09-25 +# {'contact': 'NCI', +# 'created': None, +# 'description': 'Replicated CMIP5-era datasets catalogued by NCI', +# 'email': 'help@nci.org.au', +# 'experiment_uuid': '658c95cc-c299-450c-82a1-b2b2308f7c6e', +# 'keywords': ['cmip'], +# 'license': None, +# 'long_description': 'All CMIP5-era replicated data contained under the project al33. All file versions present are in the listing. Maintained By: NCI Contact: help@nci.org.au References: https://pcmdi.llnl.gov/mips/cmip5/', +# 'model': ['CMIP5'], +# 'name': 'cmip5_al33', +# 'nominal_resolution': [None], +# 'notes': 'null', +# 'parent_experiment': None, +# 'reference': None, +# 'related_experiments': [None], +# 'url': 'https://geonetwork.nci.org.au/geonetwork/srv/eng/catalog.search#/metadata/f9489_5106_5649_5038', +# 'version': None, +# 'catalog_dir': ''} + +name: cmip5_al33 +experiment_uuid: 658c95cc-c299-450c-82a1-b2b2308f7c6e +description: Replicated CMIP5-era datasets catalogued by NCI +long_description: >- + All CMIP5-era replicated data contained under the project al33. + All file versions present are in the listing. + Maintained By: NCI + Contact: help@nci.org.au + References: https://pcmdi.llnl.gov/mips/cmip5/ +model: +- CMIP5 +realm: +- atmos +- ocean +- aerosol +- ocnBgchem +- land +- seaIce +- landIce +- landonly +version: +contact: NCI +email: help@nci.org.au +created: +reference: +license: +url: https://geonetwork.nci.org.au/geonetwork/srv/eng/catalog.search#/metadata/f9489_5106_5649_5038 +parent_experiment: +related_experiments: +- +notes: +- cmip \ No newline at end of file diff --git a/config/experiments/cmip5-rr3/metadata.yaml b/config/experiments/cmip5-rr3/metadata.yaml new file mode 100644 index 0000000..e9bac5d --- /dev/null +++ b/config/experiments/cmip5-rr3/metadata.yaml @@ -0,0 +1,60 @@ +# Metadata recovered 2024-09-25 +# {'contact': 'NCI', +# 'created': None, +# 'description': 'Australian CMIP5-era datasets catalogued by NCI', +# 'email': 'help@nci.org.au', +# 'experiment_uuid': '473d0c44-ab66-458c-b32e-1e1774175853', +# 'keywords': ['cmip'], +# 'license': None, +# 'long_description': 'All CMIP5-era Australian published data contained under the project rr3. All file versions present are in the listing. Maintained By: NCI Contact: help@nci.org.au References: https://pcmdi.llnl.gov/mips/cmip5/', +# 'model': ['CMIP5'], +# 'name': 'cmip5_rr3', +# 'nominal_resolution': [None], +# 'notes': 'null', +# 'parent_experiment': None, +# 'reference': None, +# 'related_experiments': [None], +# 'url': 'https://geonetwork.nci.org.au/geonetwork/srv/eng/catalog.search#/metadata/f7448_2157_9857_1076', +# 'version': None, +# 'catalog_dir': ''} +# +name: cmip5_rr3 +experiment_uuid: 473d0c44-ab66-458c-b32e-1e1774175853 +description: Australian CMIP5-era datasets catalogued by NCI +long_description: >- + All CMIP5-era Australian published data contained under the project rr3. + All file versions present are in the listing. + Maintained By: NCI + Contact: help@nci.org.au + References: https://pcmdi.llnl.gov/mips/cmip5/ +realm: +- atmos +- ocean +- seaIce +- landIce +- land +- aerosol +model: +- CMIP5 +frequency: +- 1hr +- mon +- day +- 6hr +- sem +- 3hr +- fx +nominal_resolution: +- +version: +contact: NCI +email: help@nci.org.au +created: +reference: +license: +url: https://geonetwork.nci.org.au/geonetwork/srv/eng/catalog.search#/metadata/f7448_2157_9857_1076 +related_experiments: +- +notes: +keywords: +- cmip \ No newline at end of file diff --git a/config/experiments/cmip6-fs38/metadata.yaml b/config/experiments/cmip6-fs38/metadata.yaml new file mode 100644 index 0000000..0770af9 --- /dev/null +++ b/config/experiments/cmip6-fs38/metadata.yaml @@ -0,0 +1,54 @@ +name: cmip6_fs38 +experiment_uuid: dfdeb421-5c56-4d58-a0b2-04b717e5cff7 +description: Australian CMIP6-era datasets catalogued by NCI +long_description: >- + All CMIP6-era Australian published data contained under the project fs38. + All file versions present are in the listing. + Maintained By: NCI + Contact: help@nci.org.au + References: https://pcmdi.llnl.gov/CMIP6/ +model: +- CMIP6 +realm: +- ocnBgchem +- land +- ocean +- atmos +- landIce +- seaIce +- aerosol +nominal_resolution: +- +version: +contact: NCI +email: help@nci.org.au +created: +reference: +license: +url: https://geonetwork.nci.org.au/geonetwork/srv/eng/catalog.search#/metadata/f3154_9976_7262_7595 +parent_experiment: +related_experiments: +- +notes: +keywords: +- cmip + +# Metadata recovered 2024-09-25 +# {'contact': 'NCI', +# 'created': None, +# 'description': 'Australian CMIP6-era datasets catalogued by NCI', +# 'email': 'help@nci.org.au', +# 'experiment_uuid': 'dfdeb421-5c56-4d58-a0b2-04b717e5cff7', +# 'keywords': ['cmip'], +# 'license': None, +# 'long_description': 'All CMIP6-era Australian published data contained under the project fs38. All file versions present are in the listing. Maintained By: NCI Contact: help@nci.org.au References: https://pcmdi.llnl.gov/CMIP6/', +# 'model': ['CMIP6'], +# 'name': 'cmip6_fs38', +# 'nominal_resolution': [None], +# 'notes': 'null', +# 'parent_experiment': None, +# 'reference': None, +# 'related_experiments': [None], +# 'url': 'https://geonetwork.nci.org.au/geonetwork/srv/eng/catalog.search#/metadata/f3154_9976_7262_7595', +# 'version': None, +# 'catalog_dir': ''} \ No newline at end of file diff --git a/config/experiments/cmip6-oi10/metadata.yaml b/config/experiments/cmip6-oi10/metadata.yaml new file mode 100644 index 0000000..6d1050d --- /dev/null +++ b/config/experiments/cmip6-oi10/metadata.yaml @@ -0,0 +1,61 @@ +name: cmip6_oi10 +experiment_uuid: b05038ca-8c78-4ca6-a914-ae33dd9abffe +description: Replicated CMIP6-era datasets catalogued by NCI +long_description: >- + All CMIP6-era replicated data contained under the project oi10. + All file versions present are in the listing. + Maintained By: NCI + Contact: help@nci.org.au + References: https://pcmdi.llnl.gov/CMIP6/ +model: +- CMIP6 +realm: +- atmos +- ocean +- land +- seaIce +- aerosol +- landIce +- ocnBgchem +- seaIce ocean +- atmos land +- ocnBgChem +- landIce land +- seaice +- ocean seaIce +- atmos atmosChem +nominal_resolution: +- +version: +contact: NCI +email: help@nci.org.au +created: +reference: +license: +url: https://geonetwork.nci.org.au/geonetwork/srv/eng/catalog.search#/metadata/f5194_5909_8003_9216 +parent_experiment: +related_experiments: +- +notes: +keywords: +- cmip + +# Metadata recovered 2024-09-25 +# {'contact': 'NCI', +# 'created': None, +# 'description': 'Replicated CMIP6-era datasets catalogued by NCI', +# 'email': 'help@nci.org.au', +# 'experiment_uuid': 'b05038ca-8c78-4ca6-a914-ae33dd9abffe', +# 'keywords': ['cmip'], +# 'license': None, +# 'long_description': 'All CMIP6-era replicated data contained under the project oi10. All file versions present are in the listing. Maintained By: NCI Contact: help@nci.org.au References: https://pcmdi.llnl.gov/CMIP6/', +# 'model': ['CMIP6'], +# 'name': 'cmip6_oi10', +# 'nominal_resolution': [None], +# 'notes': 'null', +# 'parent_experiment': None, +# 'reference': None, +# 'related_experiments': [None], +# 'url': 'https://geonetwork.nci.org.au/geonetwork/srv/eng/catalog.search#/metadata/f5194_5909_8003_9216', +# 'version': None, +# 'catalog_dir': ''} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index cbd4a54..1a6c665 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,11 @@ requires = [ where = ["src"] [tool.setuptools.package-data] -access_nri_intake = ["data/catalog.yaml"] +access_nri_intake = [ + "data/catalog.yaml", + "data/metadata_schema_experiment.json", + "data/metadata_schema_file.json", +] [tool.versioneer] VCS = "git" diff --git a/src/access_nri_intake/catalog/__init__.py b/src/access_nri_intake/catalog/__init__.py index b87c43c..386c7ef 100644 --- a/src/access_nri_intake/catalog/__init__.py +++ b/src/access_nri_intake/catalog/__init__.py @@ -18,11 +18,9 @@ NAME_COLUMN = "name" TRANSLATOR_GROUPBY_COLUMNS = ["model", "realm", "frequency"] -SCHEMA_URL = "https://raw.githubusercontent.com/ACCESS-NRI/schema/e9055da95093ec2faa555c090fc5af17923d1566/au.org.access-nri/model/output/experiment-metadata/1-0-2.json" -SCHEMA_HASH = "ecb72c1adde3679896ceeca96aa6500d07ea2e05810155ec7a5dc301593c1dc7" EXP_JSONSCHEMA, CATALOG_JSONSCHEMA = get_jsonschema( - url=SCHEMA_URL, known_hash=SCHEMA_HASH, required=CORE_COLUMNS + metadata_file="data/metadata_schema_experiment.json", required=CORE_COLUMNS ) COLUMNS_WITH_ITERABLES = [ diff --git a/src/access_nri_intake/cli.py b/src/access_nri_intake/cli.py index ed53c0a..5253ec5 100644 --- a/src/access_nri_intake/cli.py +++ b/src/access_nri_intake/cli.py @@ -16,7 +16,7 @@ from .catalog import EXP_JSONSCHEMA, translators from .catalog.manager import CatalogManager from .source import builders -from .utils import _can_be_array, load_metadata_yaml +from .utils import _can_be_array, get_catalog_fp, load_metadata_yaml class MetadataCheckError(Exception): @@ -214,9 +214,8 @@ def _get_project(path): # Save the catalog cm.save() - _here = os.path.abspath(os.path.dirname(__file__)) if update: - with open(os.path.join(_here, "data", "catalog.yaml"), "w") as fobj: + with get_catalog_fp().open(mode="w") as fobj: yaml.dump(yaml_dict, fobj) diff --git a/src/access_nri_intake/data/__init__.py b/src/access_nri_intake/data/__init__.py index bede7b7..2e08346 100644 --- a/src/access_nri_intake/data/__init__.py +++ b/src/access_nri_intake/data/__init__.py @@ -1,9 +1,8 @@ # Copyright 2023 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. # SPDX-License-Identifier: Apache-2.0 -import os - import intake -_here = os.path.abspath(os.path.dirname(__file__)) -data = intake.open_catalog(os.path.join(_here, "catalog.yaml")).access_nri +from access_nri_intake.utils import get_catalog_fp + +data = intake.open_catalog(get_catalog_fp()).access_nri diff --git a/src/access_nri_intake/data/metadata_schema_experiment.json b/src/access_nri_intake/data/metadata_schema_experiment.json new file mode 100644 index 0000000..2d0d02b --- /dev/null +++ b/src/access_nri_intake/data/metadata_schema_experiment.json @@ -0,0 +1,169 @@ +{ + "$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/main/au.org.access-nri/model/output/experiment-metadata/1-0-2.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Experiment metadata", + "description": "The metadata associated with a model experiment", + "type": "object", + "properties": { + "schema_version": { + "const": "1-0-2", + "description": "The version of the schema (string)" + }, + "name": { + "type": "string", + "description": "The name of the experiment (string)" + }, + "experiment_uuid": { + "type": "string", + "format": "uuid", + "description": "Unique uuid for the experiment (string)" + }, + "description": { + "type": "string", + "description": "Short description of the experiment (string, < 150 char)" + }, + "long_description": { + "type": "string", + "description": "Long description of the experiment (string)" + }, + "model": { + "oneOf": [ + {"type": ["string", "null"]}, + { + "type": "array", + "items": {"type": ["string", "null"]} + } + ], + "description": "The name(s) of the model(s) used in the experiment (string)" + }, + "realm": { + "type": "array", + "items": { + "oneOf": [ + {"type": "null"}, + { + "type": "string", + "enum": [ + "aerosol", + "atmos", + "atmosChem", + "land", + "landIce", + "none", + "ocean", + "ocnBgchem", + "seaIce", + "unknown", + "wave" + ] + } + ] + }, + "description": "The realm(s) included in the experiment (string)" + }, + "frequency": { + "type": "array", + "items": { + "oneOf": [ + {"type": "null"}, + { + "type": "string", + "oneOf": [ + { + "pattern": "^fx$" + }, + { + "pattern": "^subhr$" + }, + { + "pattern": "^\\d+hr$" + }, + { + "pattern": "^\\d+day$" + }, + { + "pattern": "^\\d+mon$" + }, + { + "pattern": "^\\d+yr$" + }, + { + "pattern": "^\\d+dec$" + } + ] + } + ] + }, + "description": "The frequency(/ies) included in the experiment (string)" + }, + "variable": { + "type": "array", + "items": { + "type": ["string", "null"] + }, + "description": "The variable(s) included in the experiment (string)" + }, + "nominal_resolution": { + "type": "array", + "items": {"type": ["string", "null"]}, + "description": "The nominal resolution(s) of model(s) used in the experiment (string)" + }, + "version": { + "type": ["number", "string", "null"], + "description": "The version of the experiment (number, string)" + }, + "contact": { + "type": ["string", "null"], + "description": "Contact name for the experiment (string)" + }, + "email": { + "type": ["string", "null"], + "description": "Email address of the contact for the experiment (string)" + }, + "created": { + "type": ["string", "null"], + "description": "Initial creation date of experiment (string)" + }, + "reference": { + "type": ["string", "null"], + "description": "Citation or reference information (string)" + }, + "license": { + "type": ["string", "null"], + "description": "License of the experiment (string)" + }, + "url": { + "type": ["string", "null"], + "description": "Relevant url, e.g. github repo for experiment configuration (string)" + }, + "parent_experiment": { + "type": ["string", "null"], + "description": "experiment_uuid for parent experiment if appropriate (string)" + }, + "related_experiments": { + "type": "array", + "items": { + "type": ["string", "null"] + }, + "description": "experiment_uuids for any related experiment(s) (string)" + }, + "notes": { + "type": ["string", "null"], + "description": "Additional notes (string)" + }, + "keywords": { + "type": "array", + "items": { + "type": ["string", "null"] + }, + "description": "Keywords to associated with experiment (string)" + } + }, + "required": [ + "name", + "experiment_uuid", + "description", + "long_description" + ], + "additionalProperties": false +} diff --git a/src/access_nri_intake/data/metadata_schema_file.json b/src/access_nri_intake/data/metadata_schema_file.json new file mode 100644 index 0000000..5e02b4b --- /dev/null +++ b/src/access_nri_intake/data/metadata_schema_file.json @@ -0,0 +1,132 @@ +{ + "$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/main/au.org.access-nri/model/output/file-metadata/1-0-1.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "File metadata", + "description": "The metadata associated with a file containing or referencing climate model data", + "type": "object", + "properties": { + "schema_version": { + "const": "1-0-1", + "description": "The version of the schema (string)" + }, + "path": { + "type": "string", + "description": "The path to the file asset" + }, + "realm": { + "type": "string", + "enum": [ + "aerosol", + "atmos", + "atmosChem", + "land", + "landIce", + "none", + "ocean", + "ocnBgchem", + "seaIce", + "unknown", + "wave" + ], + "description": "The realm of the data in the file asset" + }, + "variable": { + "type": "array", + "items": { + "type": ["string", "null"] + }, + "description": "The variable(s) in the file asset" + }, + "variable_long_name": { + "type": "array", + "items": { + "type": ["string", "null"] + }, + "description": "The long_name(s) of the variable(s) in the file asset" + }, + "variable_standard_name": { + "type": "array", + "items": { + "type": ["string", "null"] + }, + "description": "The standard_names(s) of the variable(s) in the file asset" + }, + "variable_cell_methods": { + "type": "array", + "items": { + "type": ["string", "null"] + }, + "description": "The cell_methods(s) of the variable(s) in the file asset" + }, + "variable_units": { + "type": "array", + "items": { + "type": ["string", "null"] + }, + "description": "The units of the variable(s) in the file asset" + }, + "frequency": { + "type": "string", + "oneOf": [ + { + "pattern": "^fx$" + }, + { + "pattern": "^subhr$" + }, + { + "pattern": "^\\d+hr$" + }, + { + "pattern": "^\\d+day$" + }, + { + "pattern": "^\\d+mon$" + }, + { + "pattern": "^\\d+yr$" + }, + { + "pattern": "^\\d+dec$" + } + ], + "description": "The frequency of the variable(s) in the file asset" + }, + "start_date": { + "type": "string", + "oneOf": [ + { + "pattern": "^\\d\\d\\d\\d-\\d\\d-\\d\\d,\\s\\d\\d:\\d\\d:\\d\\d$" + }, + { + "pattern": "none" + } + ], + "description": "The start date of the variable(s) in the file asset" + }, + "end_date": { + "type": "string", + "oneOf": [ + { + "pattern": "^\\d\\d\\d\\d-\\d\\d-\\d\\d,\\s\\d\\d:\\d\\d:\\d\\d$" + }, + { + "pattern": "none" + } + ], + "description": "The end date of the variable(s) in the file asset" + }, + "nominal_resolution": { + "type": "string", + "description": "The nominal resolution of the variable(s) in the file asset" + } + }, + "required": [ + "path", + "realm", + "variable", + "frequency", + "start_date", + "end_date" + ] +} diff --git a/src/access_nri_intake/source/__init__.py b/src/access_nri_intake/source/__init__.py index 4f0242a..9a9c5ac 100644 --- a/src/access_nri_intake/source/__init__.py +++ b/src/access_nri_intake/source/__init__.py @@ -17,9 +17,7 @@ PATH_COLUMN = "path" VARIABLE_COLUMN = "variable" -SCHEMA_URL = "https://raw.githubusercontent.com/ACCESS-NRI/schema/e9055da95093ec2faa555c090fc5af17923d1566/au.org.access-nri/model/output/file-metadata/1-0-1.json" -SCHEMA_HASH = "8f2f069fa06d81ff086b91daa6503f75615aa90385ab61ee2d1a7956dc96f9a6" _, ESM_JSONSCHEMA = get_jsonschema( - url=SCHEMA_URL, known_hash=SCHEMA_HASH, required=CORE_COLUMNS + metadata_file="data/metadata_schema_file.json", required=CORE_COLUMNS ) diff --git a/src/access_nri_intake/utils.py b/src/access_nri_intake/utils.py index af2e6a6..b2895f6 100644 --- a/src/access_nri_intake/utils.py +++ b/src/access_nri_intake/utils.py @@ -4,32 +4,25 @@ """ General utility functions for access-rni-intake """ import json +from importlib import resources as rsr from warnings import warn import jsonschema -import pooch import yaml -def get_jsonschema(url, known_hash, required): +def get_jsonschema(metadata_file, required): """ - Download a jsonschema from a url. Returns the unaltered jsonschema and a version with the "required" key - matching the properties provided. + Read in the required JSON schema, and annotate it with "required" fields. Parameters ---------- - url: str - The URL to the jsonschema file. ACCESS-NRI schema can be found at - https://github.com/ACCESS-NRI/schema. - known_hash: str - A known hash (checksum) of the file. See :py:func:`~pooch.retrieve`. required: list A list of the properties to include in the "required" key """ - schema_file = pooch.retrieve(url=url, known_hash=known_hash) - - with open(schema_file) as fpath: + schema_file = rsr.files("access_nri_intake").joinpath(metadata_file) + with schema_file.open(mode="r") as fpath: schema = json.load(fpath) schema_required = schema.copy() @@ -123,3 +116,7 @@ def _is_array(field): for nfield in field["oneOf"]: is_array = is_array or _is_array(nfield) return is_array + + +def get_catalog_fp(): + return rsr.files("access_nri_intake").joinpath("data/catalog.yaml") diff --git a/tests/test_data.py b/tests/test_data.py new file mode 100644 index 0000000..514df27 --- /dev/null +++ b/tests/test_data.py @@ -0,0 +1,15 @@ +# Copyright 2024 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. +# SPDX-License-Identifier: Apache-2.0 + +import os + +from access_nri_intake.utils import get_catalog_fp + + +def test_get_catalog_fp(): + _oneup = os.path.abspath(os.path.dirname("../")) + assert str(get_catalog_fp()) == str( + os.path.join( + _oneup, "access-nri-intake-catalog/src/access_nri_intake/data/catalog.yaml" + ) + ) diff --git a/tests/test_utils.py b/tests/test_utils.py index 8bc3810..51748e5 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -14,26 +14,25 @@ @pytest.mark.parametrize( - "known_hash", - ["2a09030653f495939c90a22e95dd1c4587c8695f7f07e17b9129a6491469f9fc", None], + "schema_file", + ["data/metadata_schema_experiment.json", "data/metadata_schema_file.json"], ) -def test_get_jsonschema(known_hash): +def test_get_jsonschema(schema_file): """ - Test that jsonschema are correctly downloaded and required fields are overwritten + Test that required fields are overwritten """ - url = "https://raw.githubusercontent.com/ACCESS-NRI/schema/4e3d10e563d7c1c9f66e9ab92a2926cdec3d6893/file_asset.json" required = [ - "path", + "realm", ] schema, schema_required = get_jsonschema( - url=url, known_hash=known_hash, required=required + metadata_file=schema_file, required=required ) assert "$schema" in schema assert schema_required["required"] == required required += ["foo"] with pytest.warns(UserWarning): - _, _ = get_jsonschema(url=url, known_hash=known_hash, required=required) + _, _ = get_jsonschema(metadata_file=schema_file, required=required) def test_load_metadata_yaml(tmp_path):