climate-ref-core 0.6.2__tar.gz → 0.6.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/PKG-INFO +1 -1
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/pyproject.toml +1 -1
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/dataset_registry.py +1 -1
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/providers.py +8 -10
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_providers.py +7 -7
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/.gitignore +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/LICENCE +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/NOTICE +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/README.md +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/__init__.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/constraints.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/datasets.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/diagnostics.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/env.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/exceptions.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/executor.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/logging.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/metric_values/__init__.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/metric_values/typing.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/py.typed +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/pycmec/README.md +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/pycmec/__init__.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/pycmec/controlled_vocabulary.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/pycmec/cv_cmip7_aft.yaml +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/pycmec/metric.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/pycmec/output.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/metric_values/test_typing.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/cmec_testdata/cmec_metric_sample.json +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/cmec_testdata/cmec_output_sample.json +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/cmec_testdata/cv_sample.yaml +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/cmec_testdata/test_metric_json_schema.yml +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/cmec_testdata/test_output_json_schema.yml +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/conftest.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/test_cmec_metric.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/test_cmec_output.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/test_controlled_vocabulary.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_constraints.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_dataset_registry/test_dataset_registry.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_datasets/dataset_collection_hash.yml +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_datasets/dataset_collection_obs4mips_hash.yml +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_datasets/metric_dataset_hash.yml +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_datasets.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_exceptions.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_executor.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_logging.py +0 -0
- {climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_metrics.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: climate-ref-core
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
4
4
|
Summary: Core library for the CMIP Rapid Evaluation Framework
|
|
5
5
|
Author-email: Jared Lewis <jared.lewis@climate-resource.com>, Mika Pflueger <mika.pflueger@climate-resource.com>, Bouwe Andela <b.andela@esciencecenter.nl>, Jiwoo Lee <lee1043@llnl.gov>, Min Xu <xum1@ornl.gov>, Nathan Collier <collierno@ornl.gov>, Dora Hegedus <dora.hegedus@stfc.ac.uk>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -18,7 +18,7 @@ from rich.progress import track
|
|
|
18
18
|
|
|
19
19
|
from climate_ref_core.env import env
|
|
20
20
|
|
|
21
|
-
DATASET_URL = env.str("REF_DATASET_URL", default="https://
|
|
21
|
+
DATASET_URL = env.str("REF_DATASET_URL", default="https://obs4ref.climate-ref.org")
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def _verify_hash_matches(fname: str | pathlib.Path, known_hash: str) -> bool:
|
|
@@ -136,7 +136,7 @@ def import_provider(fqn: str) -> DiagnosticProvider:
|
|
|
136
136
|
fqn
|
|
137
137
|
Full package and attribute name of the provider to import
|
|
138
138
|
|
|
139
|
-
For example: `climate_ref_example
|
|
139
|
+
For example: `climate_ref_example:provider` will use the `provider` attribute from the
|
|
140
140
|
`climate_ref_example` package.
|
|
141
141
|
|
|
142
142
|
If only a package name is provided, the default attribute name is `provider`.
|
|
@@ -153,24 +153,22 @@ def import_provider(fqn: str) -> DiagnosticProvider:
|
|
|
153
153
|
:
|
|
154
154
|
DiagnosticProvider instance
|
|
155
155
|
"""
|
|
156
|
-
if "
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
name = "provider"
|
|
156
|
+
if ":" not in fqn:
|
|
157
|
+
fqn = f"{fqn}:provider"
|
|
158
|
+
|
|
159
|
+
entrypoint = importlib.metadata.EntryPoint(name="provider", value=fqn, group="climate-ref.providers")
|
|
161
160
|
|
|
162
161
|
try:
|
|
163
|
-
|
|
164
|
-
provider = getattr(imp, name)
|
|
162
|
+
provider = entrypoint.load()
|
|
165
163
|
if not isinstance(provider, DiagnosticProvider):
|
|
166
164
|
raise InvalidProviderException(fqn, f"Expected DiagnosticProvider, got {type(provider)}")
|
|
167
165
|
return provider
|
|
168
166
|
except ModuleNotFoundError:
|
|
169
167
|
logger.error(f"Module '{fqn}' not found")
|
|
170
|
-
raise InvalidProviderException(fqn,
|
|
168
|
+
raise InvalidProviderException(fqn, "Module not found")
|
|
171
169
|
except AttributeError:
|
|
172
170
|
logger.error(f"Provider '{fqn}' not found")
|
|
173
|
-
raise InvalidProviderException(fqn,
|
|
171
|
+
raise InvalidProviderException(fqn, "Provider not found in module")
|
|
174
172
|
|
|
175
173
|
|
|
176
174
|
class CommandLineDiagnosticProvider(DiagnosticProvider):
|
|
@@ -52,7 +52,7 @@ class TestMetricsProvider:
|
|
|
52
52
|
assert isinstance(result, Diagnostic)
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
@pytest.mark.parametrize("fqn", ["climate_ref_esmvaltool
|
|
55
|
+
@pytest.mark.parametrize("fqn", ["climate_ref_esmvaltool:provider", "climate_ref_esmvaltool"])
|
|
56
56
|
def test_import_provider(fqn):
|
|
57
57
|
provider = import_provider(fqn)
|
|
58
58
|
|
|
@@ -63,21 +63,21 @@ def test_import_provider(fqn):
|
|
|
63
63
|
|
|
64
64
|
def test_import_provider_missing():
|
|
65
65
|
fqn = "climate_ref"
|
|
66
|
-
match = f"Invalid provider: '{fqn}'\n Provider
|
|
66
|
+
match = f"Invalid provider: '{fqn}.provider'\n Provider not found in module"
|
|
67
67
|
with pytest.raises(InvalidProviderException, match=match):
|
|
68
68
|
import_provider(fqn)
|
|
69
69
|
|
|
70
|
-
fqn = "climate_ref.datasets
|
|
71
|
-
match = f"Invalid provider: '{fqn}'\n Provider
|
|
70
|
+
fqn = "climate_ref.datasets:WrongProvider"
|
|
71
|
+
match = f"Invalid provider: '{fqn}'\n Provider not found in module"
|
|
72
72
|
with pytest.raises(InvalidProviderException, match=match):
|
|
73
73
|
import_provider(fqn)
|
|
74
74
|
|
|
75
|
-
fqn = "missing.local
|
|
76
|
-
match = f"Invalid provider: '{fqn}'\n Module
|
|
75
|
+
fqn = "missing.local:WrongProvider"
|
|
76
|
+
match = f"Invalid provider: '{fqn}'\n Module not found"
|
|
77
77
|
with pytest.raises(InvalidProviderException, match=match):
|
|
78
78
|
import_provider(fqn)
|
|
79
79
|
|
|
80
|
-
fqn = "climate_ref
|
|
80
|
+
fqn = "climate_ref:__version__"
|
|
81
81
|
match = f"Invalid provider: '{fqn}'\n Expected DiagnosticProvider, got <class 'str'>"
|
|
82
82
|
with pytest.raises(InvalidProviderException, match=match):
|
|
83
83
|
import_provider(fqn)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/metric_values/__init__.py
RENAMED
|
File without changes
|
{climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/metric_values/typing.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/src/climate_ref_core/pycmec/cv_cmip7_aft.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/cmec_testdata/cv_sample.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/pycmec/test_controlled_vocabulary.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{climate_ref_core-0.6.2 → climate_ref_core-0.6.4}/tests/unit/test_datasets/metric_dataset_hash.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|