From b487a3495f960f1be7fe1d8249ccb23601566bb7 Mon Sep 17 00:00:00 2001 From: Marc White Date: Thu, 29 Aug 2024 10:51:33 +1000 Subject: [PATCH 1/7] Incorporated metadata schemas as package data Also flagged a couple of spots where more 'correct' package data importing should be used --- pyproject.toml | 6 +- src/access_nri_intake/catalog/__init__.py | 6 +- src/access_nri_intake/cli.py | 1 + src/access_nri_intake/data/__init__.py | 1 + .../data/metadata_schema_experiment.json | 168 ++++++++++++++++++ .../data/metadata_schema_file.json | 131 ++++++++++++++ src/access_nri_intake/source/__init__.py | 6 +- src/access_nri_intake/utils.py | 17 +- tests/test_utils.py | 15 +- 9 files changed, 324 insertions(+), 27 deletions(-) create mode 100644 src/access_nri_intake/data/metadata_schema_experiment.json create mode 100644 src/access_nri_intake/data/metadata_schema_file.json 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..f6f0918 100644 --- a/src/access_nri_intake/catalog/__init__.py +++ b/src/access_nri_intake/catalog/__init__.py @@ -18,11 +18,11 @@ 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" +# 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..e2e1fd6 100644 --- a/src/access_nri_intake/cli.py +++ b/src/access_nri_intake/cli.py @@ -216,6 +216,7 @@ def _get_project(path): _here = os.path.abspath(os.path.dirname(__file__)) if update: + # FIXME use correct package data handling with open(os.path.join(_here, "data", "catalog.yaml"), "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..09b0dc8 100644 --- a/src/access_nri_intake/data/__init__.py +++ b/src/access_nri_intake/data/__init__.py @@ -5,5 +5,6 @@ import intake +## FIXME use correct package data handling _here = os.path.abspath(os.path.dirname(__file__)) data = intake.open_catalog(os.path.join(_here, "catalog.yaml")).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..b1b5c15 --- /dev/null +++ b/src/access_nri_intake/data/metadata_schema_experiment.json @@ -0,0 +1,168 @@ +{ + "$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..bd98d27 --- /dev/null +++ b/src/access_nri_intake/data/metadata_schema_file.json @@ -0,0 +1,131 @@ +{ + "$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..5d77f45 100644 --- a/src/access_nri_intake/source/__init__.py +++ b/src/access_nri_intake/source/__init__.py @@ -17,9 +17,9 @@ 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" +# 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..1e320a6 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() 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): From 7341436d11ad4d2db86bf1269a0271ae6af8f4fa Mon Sep 17 00:00:00 2001 From: Marc White Date: Thu, 29 Aug 2024 11:41:17 +1000 Subject: [PATCH 2/7] Updates where old-style data file import was located --- src/access_nri_intake/cli.py | 9 ++++++--- src/access_nri_intake/data/__init__.py | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/access_nri_intake/cli.py b/src/access_nri_intake/cli.py index e2e1fd6..0467f8f 100644 --- a/src/access_nri_intake/cli.py +++ b/src/access_nri_intake/cli.py @@ -4,6 +4,7 @@ """ Command line interfaces for access-nri-intake """ import argparse +import importlib import logging import os import re @@ -214,10 +215,12 @@ def _get_project(path): # Save the catalog cm.save() - _here = os.path.abspath(os.path.dirname(__file__)) if update: - # FIXME use correct package data handling - with open(os.path.join(_here, "data", "catalog.yaml"), "w") as fobj: + with ( + importlib.resources.files("access_nri_intake") + .joinpath("data/catalog.yaml") + .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 09b0dc8..e447042 100644 --- a/src/access_nri_intake/data/__init__.py +++ b/src/access_nri_intake/data/__init__.py @@ -1,10 +1,11 @@ # Copyright 2023 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. # SPDX-License-Identifier: Apache-2.0 -import os +import importlib import intake -## FIXME use correct package data handling -_here = os.path.abspath(os.path.dirname(__file__)) -data = intake.open_catalog(os.path.join(_here, "catalog.yaml")).access_nri +data = intake.open_catalog( + importlib.resources.files("access_nri_intake").joinpath("data/catalog.yaml") + # os.path.join(_here, "catalog.yaml") +).access_nri From 26f7395715394e0432d75402ea0e5aa43964240e Mon Sep 17 00:00:00 2001 From: Marc White Date: Mon, 9 Sep 2024 09:34:18 +1000 Subject: [PATCH 3/7] Return $id to metadata files, remove URLs from __init__ files --- src/access_nri_intake/catalog/__init__.py | 2 -- src/access_nri_intake/data/metadata_schema_experiment.json | 1 + src/access_nri_intake/data/metadata_schema_file.json | 1 + src/access_nri_intake/source/__init__.py | 2 -- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/access_nri_intake/catalog/__init__.py b/src/access_nri_intake/catalog/__init__.py index f6f0918..386c7ef 100644 --- a/src/access_nri_intake/catalog/__init__.py +++ b/src/access_nri_intake/catalog/__init__.py @@ -18,8 +18,6 @@ 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( metadata_file="data/metadata_schema_experiment.json", required=CORE_COLUMNS diff --git a/src/access_nri_intake/data/metadata_schema_experiment.json b/src/access_nri_intake/data/metadata_schema_experiment.json index b1b5c15..15769bf 100644 --- a/src/access_nri_intake/data/metadata_schema_experiment.json +++ b/src/access_nri_intake/data/metadata_schema_experiment.json @@ -1,4 +1,5 @@ { + "$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/e9055da95093ec2faa555c090fc5af17923d1566/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", diff --git a/src/access_nri_intake/data/metadata_schema_file.json b/src/access_nri_intake/data/metadata_schema_file.json index bd98d27..3fe709c 100644 --- a/src/access_nri_intake/data/metadata_schema_file.json +++ b/src/access_nri_intake/data/metadata_schema_file.json @@ -1,4 +1,5 @@ { + "$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/e9055da95093ec2faa555c090fc5af17923d1566/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", diff --git a/src/access_nri_intake/source/__init__.py b/src/access_nri_intake/source/__init__.py index 5d77f45..9a9c5ac 100644 --- a/src/access_nri_intake/source/__init__.py +++ b/src/access_nri_intake/source/__init__.py @@ -17,8 +17,6 @@ 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( metadata_file="data/metadata_schema_file.json", required=CORE_COLUMNS From 7fcbd55943e5cfb1186e1486e1ce178d6e3a800c Mon Sep 17 00:00:00 2001 From: Marc White Date: Mon, 9 Sep 2024 11:34:01 +1000 Subject: [PATCH 4/7] Helper function for getting catalog.yaml (plus test) --- src/access_nri_intake/cli.py | 9 ++------- src/access_nri_intake/data/__init__.py | 9 ++++++--- src/access_nri_intake/utils.py | 4 ++++ tests/test_data.py | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 tests/test_data.py diff --git a/src/access_nri_intake/cli.py b/src/access_nri_intake/cli.py index 0467f8f..5253ec5 100644 --- a/src/access_nri_intake/cli.py +++ b/src/access_nri_intake/cli.py @@ -4,7 +4,6 @@ """ Command line interfaces for access-nri-intake """ import argparse -import importlib import logging import os import re @@ -17,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): @@ -216,11 +215,7 @@ def _get_project(path): cm.save() if update: - with ( - importlib.resources.files("access_nri_intake") - .joinpath("data/catalog.yaml") - .open(mode="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 e447042..474d015 100644 --- a/src/access_nri_intake/data/__init__.py +++ b/src/access_nri_intake/data/__init__.py @@ -1,11 +1,14 @@ # Copyright 2023 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. # SPDX-License-Identifier: Apache-2.0 -import importlib - +# import importlib +# import importlib.resources import intake +from access_nri_intake.utils import get_catalog_fp + data = intake.open_catalog( - importlib.resources.files("access_nri_intake").joinpath("data/catalog.yaml") + # importlib.resources.files("access_nri_intake").joinpath("data/catalog.yaml") # os.path.join(_here, "catalog.yaml") + get_catalog_fp() ).access_nri diff --git a/src/access_nri_intake/utils.py b/src/access_nri_intake/utils.py index 1e320a6..b2895f6 100644 --- a/src/access_nri_intake/utils.py +++ b/src/access_nri_intake/utils.py @@ -116,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" + ) + ) From 0283850e41c34e9ff1d9630ed10bd17a4ca8cb1d Mon Sep 17 00:00:00 2001 From: Marc White Date: Mon, 9 Sep 2024 17:12:24 +1000 Subject: [PATCH 5/7] Correct $id values in schema JSON --- src/access_nri_intake/data/metadata_schema_experiment.json | 2 +- src/access_nri_intake/data/metadata_schema_file.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/access_nri_intake/data/metadata_schema_experiment.json b/src/access_nri_intake/data/metadata_schema_experiment.json index 15769bf..2d0d02b 100644 --- a/src/access_nri_intake/data/metadata_schema_experiment.json +++ b/src/access_nri_intake/data/metadata_schema_experiment.json @@ -1,5 +1,5 @@ { - "$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/e9055da95093ec2faa555c090fc5af17923d1566/au.org.access-nri/model/output/experiment-metadata/1-0-2.json", + "$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", diff --git a/src/access_nri_intake/data/metadata_schema_file.json b/src/access_nri_intake/data/metadata_schema_file.json index 3fe709c..5e02b4b 100644 --- a/src/access_nri_intake/data/metadata_schema_file.json +++ b/src/access_nri_intake/data/metadata_schema_file.json @@ -1,5 +1,5 @@ { - "$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/e9055da95093ec2faa555c090fc5af17923d1566/au.org.access-nri/model/output/file-metadata/1-0-1.json", + "$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", From 20f6e36809171a50569e5680ea965d6e8bc8a328 Mon Sep 17 00:00:00 2001 From: Marc White Date: Thu, 12 Sep 2024 15:56:47 +1000 Subject: [PATCH 6/7] Delete stray comments --- src/access_nri_intake/data/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/access_nri_intake/data/__init__.py b/src/access_nri_intake/data/__init__.py index 474d015..84ff513 100644 --- a/src/access_nri_intake/data/__init__.py +++ b/src/access_nri_intake/data/__init__.py @@ -1,8 +1,6 @@ # Copyright 2023 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. # SPDX-License-Identifier: Apache-2.0 -# import importlib -# import importlib.resources import intake from access_nri_intake.utils import get_catalog_fp From bf43d6d8fac9c0948859bc823180396f4af263df Mon Sep 17 00:00:00 2001 From: Marc White Date: Thu, 12 Sep 2024 16:14:21 +1000 Subject: [PATCH 7/7] Remove even more stray comments --- src/access_nri_intake/data/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/access_nri_intake/data/__init__.py b/src/access_nri_intake/data/__init__.py index 84ff513..2e08346 100644 --- a/src/access_nri_intake/data/__init__.py +++ b/src/access_nri_intake/data/__init__.py @@ -5,8 +5,4 @@ from access_nri_intake.utils import get_catalog_fp -data = intake.open_catalog( - # importlib.resources.files("access_nri_intake").joinpath("data/catalog.yaml") - # os.path.join(_here, "catalog.yaml") - get_catalog_fp() -).access_nri +data = intake.open_catalog(get_catalog_fp()).access_nri