climate-ref-core 0.6.4__tar.gz → 0.6.5__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.4 → climate_ref_core-0.6.5}/PKG-INFO +1 -1
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/pyproject.toml +1 -1
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/constraints.py +18 -8
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_constraints.py +16 -1
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/.gitignore +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/LICENCE +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/NOTICE +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/README.md +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/__init__.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/dataset_registry.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/datasets.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/diagnostics.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/env.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/exceptions.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/executor.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/logging.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/metric_values/__init__.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/metric_values/typing.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/providers.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/py.typed +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/pycmec/README.md +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/pycmec/__init__.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/pycmec/controlled_vocabulary.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/pycmec/cv_cmip7_aft.yaml +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/pycmec/metric.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/pycmec/output.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/metric_values/test_typing.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/pycmec/cmec_testdata/cmec_metric_sample.json +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/pycmec/cmec_testdata/cmec_output_sample.json +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/pycmec/cmec_testdata/cv_sample.yaml +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/pycmec/cmec_testdata/test_metric_json_schema.yml +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/pycmec/cmec_testdata/test_output_json_schema.yml +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/pycmec/conftest.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/pycmec/test_cmec_metric.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/pycmec/test_cmec_output.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/pycmec/test_controlled_vocabulary.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_dataset_registry/test_dataset_registry.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_datasets/dataset_collection_hash.yml +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_datasets/dataset_collection_obs4mips_hash.yml +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_datasets/metric_dataset_hash.yml +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_datasets.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_exceptions.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_executor.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_logging.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_metrics.py +0 -0
- {climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/tests/unit/test_providers.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.5
|
|
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
|
|
@@ -200,17 +200,27 @@ class AddSupplementaryDataset:
|
|
|
200
200
|
for facet, values in supplementary_facets.items():
|
|
201
201
|
mask = supplementary_group[facet].isin(values)
|
|
202
202
|
supplementary_group = supplementary_group[mask]
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
facets =
|
|
203
|
+
if not supplementary_group.empty:
|
|
204
|
+
matching_facets = list(self.matching_facets)
|
|
205
|
+
facets = matching_facets + list(self.optional_matching_facets)
|
|
206
206
|
datasets = group[facets].drop_duplicates()
|
|
207
207
|
indices = set()
|
|
208
208
|
for i in range(len(datasets)):
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
dataset = datasets.iloc[i]
|
|
210
|
+
# Restrict the supplementary datasets to those that match the main dataset.
|
|
211
|
+
supplementaries = supplementary_group[
|
|
212
|
+
(supplementary_group[matching_facets] == dataset[matching_facets]).all(1)
|
|
213
|
+
]
|
|
214
|
+
if not supplementaries.empty:
|
|
215
|
+
# Select the best matching supplementary dataset based on the optional matching facets.
|
|
216
|
+
scores = (supplementaries[facets] == dataset).sum(axis=1)
|
|
217
|
+
matches = supplementaries[scores == scores.max()]
|
|
218
|
+
if "version" in facets:
|
|
219
|
+
# Select the latest version if there are multiple matches
|
|
220
|
+
matches = matches[matches["version"] == matches["version"].max()]
|
|
221
|
+
# Select one match per dataset
|
|
222
|
+
indices.add(matches.index[0])
|
|
223
|
+
|
|
214
224
|
supplementary_group = supplementary_group.loc[list(indices)].drop_duplicates()
|
|
215
225
|
|
|
216
226
|
return pd.concat([group, supplementary_group])
|
|
@@ -60,6 +60,21 @@ class TestAddSupplementaryDataset:
|
|
|
60
60
|
),
|
|
61
61
|
[0],
|
|
62
62
|
),
|
|
63
|
+
(
|
|
64
|
+
# Test that missing supplementary files are handled gracefully.
|
|
65
|
+
pd.DataFrame(
|
|
66
|
+
{
|
|
67
|
+
"variable_id": ["tas", "areacella", "areacella", "tas"],
|
|
68
|
+
"source_id": ["X", "X", "X", "Y"],
|
|
69
|
+
"grid_label": ["gn"] * 4,
|
|
70
|
+
"table_id": ["Amon", "fx", "fx", "Amon"],
|
|
71
|
+
"experiment_id": ["historical"] * 4,
|
|
72
|
+
"member_id": ["r1i1p1f1", "r1i1p1f1", "r2i1p1f1", "r2i1p1f1"],
|
|
73
|
+
"version": ["v20210316", "v20210316", "v20210317", "v20210317"],
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
[0, 3, 1],
|
|
77
|
+
),
|
|
63
78
|
(
|
|
64
79
|
# Test that the grid_label matches.
|
|
65
80
|
pd.DataFrame(
|
|
@@ -68,7 +83,7 @@ class TestAddSupplementaryDataset:
|
|
|
68
83
|
"source_id": ["ACCESS-ESM1-5"] * 3,
|
|
69
84
|
"grid_label": ["gn", "gn", "gr"],
|
|
70
85
|
"table_id": ["Amon", "fx", "fx"],
|
|
71
|
-
"experiment_id": ["historical"
|
|
86
|
+
"experiment_id": ["historical", "piControl", "historical"],
|
|
72
87
|
"member_id": ["r1i1p1f1", "r2i1p1f1", "r1i1p1f1"],
|
|
73
88
|
"version": ["v20210316"] * 3,
|
|
74
89
|
}
|
|
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.4 → climate_ref_core-0.6.5}/src/climate_ref_core/metric_values/__init__.py
RENAMED
|
File without changes
|
{climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/src/climate_ref_core/metric_values/typing.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/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.4 → climate_ref_core-0.6.5}/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.4 → climate_ref_core-0.6.5}/tests/unit/pycmec/test_controlled_vocabulary.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{climate_ref_core-0.6.4 → climate_ref_core-0.6.5}/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
|
|
File without changes
|