climate-ref-ilamb 0.6.5__tar.gz → 0.6.6__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_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/PKG-INFO +2 -2
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/pyproject.toml +3 -3
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/configure/ilamb.yaml +1 -1
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/configure/iomb.yaml +4 -4
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/standard.py +124 -43
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/tests/integration/test_diagnostics.py +7 -4
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/tests/unit/test_standard_metrics.py +44 -21
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/.gitignore +0 -0
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/LICENCE +0 -0
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/NOTICE +0 -0
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/README.md +0 -0
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/__init__.py +0 -0
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/dataset_registry/ilamb.txt +0 -0
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/dataset_registry/iomb.txt +0 -0
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/dataset_registry/test.txt +0 -0
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/datasets.py +0 -0
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/py.typed +0 -0
- {climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/tests/unit/test_provider.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: climate-ref-ilamb
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.6
|
|
4
4
|
Summary: ILAMB diagnostic provider for the Rapid Evaluation Framework
|
|
5
5
|
Author-email: Nathan Collier <nathaniel.collier@gmail.com>, Jared Lewis <jared.lewis@climate-resource.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
19
19
|
Classifier: Topic :: Scientific/Engineering
|
|
20
20
|
Requires-Python: >=3.11
|
|
21
21
|
Requires-Dist: climate-ref-core
|
|
22
|
-
Requires-Dist: ilamb3>=2025.
|
|
22
|
+
Requires-Dist: ilamb3>=2025.9.9
|
|
23
23
|
Requires-Dist: scipy<1.16
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
25
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "climate-ref-ilamb"
|
|
3
|
-
version = "0.6.
|
|
3
|
+
version = "0.6.6"
|
|
4
4
|
description = "ILAMB diagnostic provider for the Rapid Evaluation Framework"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -24,8 +24,8 @@ classifiers = [
|
|
|
24
24
|
]
|
|
25
25
|
dependencies = [
|
|
26
26
|
"climate-ref-core",
|
|
27
|
-
"ilamb3>=2025.
|
|
28
|
-
"scipy<1.16",
|
|
27
|
+
"ilamb3>=2025.9.9",
|
|
28
|
+
"scipy<1.16", # https://github.com/statsmodels/statsmodels/issues/9584
|
|
29
29
|
]
|
|
30
30
|
[project.entry-points."climate-ref.providers"]
|
|
31
31
|
ilamb = "climate_ref_ilamb:provider"
|
{climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/configure/iomb.yaml
RENAMED
|
@@ -5,7 +5,7 @@ thetao-WOA2023-surface:
|
|
|
5
5
|
# TODO: Update to use the obs4REF equiv
|
|
6
6
|
thetao: ilamb/WOA/thetao_mon_WOA_A5B4_gn_200501-201412.nc
|
|
7
7
|
variable_cmap: Reds
|
|
8
|
-
|
|
8
|
+
transforms:
|
|
9
9
|
- select_depth:
|
|
10
10
|
value: 0
|
|
11
11
|
alternate_vars:
|
|
@@ -15,7 +15,7 @@ so-WOA2023-surface:
|
|
|
15
15
|
sources:
|
|
16
16
|
# TODO: Update to use the obs4REF equiv
|
|
17
17
|
so: ilamb/WOA/so_mon_WOA_A5B4_gn_200501-201412.nc
|
|
18
|
-
|
|
18
|
+
transforms:
|
|
19
19
|
- select_depth:
|
|
20
20
|
value: 0
|
|
21
21
|
variable_cmap: YlGn
|
|
@@ -27,7 +27,7 @@ amoc-RAPID:
|
|
|
27
27
|
- timeseries
|
|
28
28
|
related_vars:
|
|
29
29
|
- msftmz
|
|
30
|
-
|
|
30
|
+
transforms:
|
|
31
31
|
- msftmz_to_rapid
|
|
32
32
|
sources:
|
|
33
33
|
# TODO: Update to use the obs4REF equiv
|
|
@@ -39,7 +39,7 @@ ohc-NOAA:
|
|
|
39
39
|
related_vars:
|
|
40
40
|
- thetao
|
|
41
41
|
- volcello
|
|
42
|
-
|
|
42
|
+
transforms:
|
|
43
43
|
- select_depth:
|
|
44
44
|
min: 0
|
|
45
45
|
max: 2000
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from typing import Any
|
|
3
3
|
|
|
4
|
-
import ilamb3
|
|
5
|
-
import ilamb3.regions as ilr
|
|
6
|
-
import matplotlib.pyplot as plt
|
|
4
|
+
import ilamb3
|
|
5
|
+
import ilamb3.regions as ilr
|
|
7
6
|
import pandas as pd
|
|
8
7
|
import pooch
|
|
8
|
+
import xarray as xr
|
|
9
9
|
from ilamb3 import run
|
|
10
10
|
|
|
11
|
-
from climate_ref_core.constraints import AddSupplementaryDataset
|
|
11
|
+
from climate_ref_core.constraints import AddSupplementaryDataset, RequireFacets
|
|
12
12
|
from climate_ref_core.dataset_registry import dataset_registry_manager
|
|
13
13
|
from climate_ref_core.datasets import FacetFilter, SourceDatasetType
|
|
14
14
|
from climate_ref_core.diagnostics import (
|
|
@@ -17,8 +17,9 @@ from climate_ref_core.diagnostics import (
|
|
|
17
17
|
ExecutionDefinition,
|
|
18
18
|
ExecutionResult,
|
|
19
19
|
)
|
|
20
|
+
from climate_ref_core.metric_values.typing import SeriesMetricValue
|
|
20
21
|
from climate_ref_core.pycmec.metric import CMECMetric
|
|
21
|
-
from climate_ref_core.pycmec.output import CMECOutput
|
|
22
|
+
from climate_ref_core.pycmec.output import CMECOutput, OutputCV
|
|
22
23
|
from climate_ref_ilamb.datasets import (
|
|
23
24
|
registry_to_collection,
|
|
24
25
|
)
|
|
@@ -101,16 +102,7 @@ def _build_cmec_bundle(df: pd.DataFrame) -> dict[str, Any]:
|
|
|
101
102
|
# reference_df = df[df["source"] == "Reference"]
|
|
102
103
|
model_df = df[df["source"] != "Reference"]
|
|
103
104
|
|
|
104
|
-
#
|
|
105
|
-
# This assumes that the member_id and grid_label are always the last two parts of the source string
|
|
106
|
-
# and don't contain '-'
|
|
107
|
-
extracted_source = model_df.source.str.extract(r"([\w-]+)-([\w\d]+)-([\w\d]+)")
|
|
108
|
-
model_df.loc[:, "source_id"] = extracted_source[0]
|
|
109
|
-
model_df.loc[:, "member_id"] = extracted_source[1]
|
|
110
|
-
model_df.loc[:, "grid_label"] = extracted_source[2]
|
|
111
|
-
|
|
112
|
-
# Strip out units from the name
|
|
113
|
-
# These are available in the attributes
|
|
105
|
+
# Strip out units from the name (available in the attributes)
|
|
114
106
|
extracted_source = model_df.name.str.extract(r"(.*)\s\[.*\]")
|
|
115
107
|
model_df.loc[:, "name"] = extracted_source[0]
|
|
116
108
|
|
|
@@ -149,20 +141,11 @@ def _build_cmec_bundle(df: pd.DataFrame) -> dict[str, Any]:
|
|
|
149
141
|
return bundle
|
|
150
142
|
|
|
151
143
|
|
|
152
|
-
def _form_bundles(df: pd.DataFrame) -> tuple[CMECMetric, CMECOutput]:
|
|
153
|
-
"""
|
|
154
|
-
Create the output bundles (really a lift to make Ruff happy with the size of run()).
|
|
155
|
-
"""
|
|
156
|
-
metric_bundle = _build_cmec_bundle(df)
|
|
157
|
-
output_bundle = CMECOutput.create_template()
|
|
158
|
-
return CMECMetric.model_validate(metric_bundle), CMECOutput.model_validate(output_bundle)
|
|
159
|
-
|
|
160
|
-
|
|
161
144
|
def _set_ilamb3_options(registry: pooch.Pooch, registry_file: str) -> None:
|
|
162
145
|
"""
|
|
163
146
|
Set options for ILAMB based on which registry file is being used.
|
|
164
147
|
"""
|
|
165
|
-
ilamb3.conf.reset()
|
|
148
|
+
ilamb3.conf.reset() # type: ignore
|
|
166
149
|
ilamb_regions = ilr.Regions()
|
|
167
150
|
if registry_file == "ilamb":
|
|
168
151
|
ilamb_regions.add_netcdf(registry.fetch("ilamb/regions/GlobalLand.nc"))
|
|
@@ -213,29 +196,52 @@ class ILAMBStandard(Diagnostic):
|
|
|
213
196
|
facets={
|
|
214
197
|
"variable_id": (
|
|
215
198
|
self.variable_id,
|
|
216
|
-
*ilamb_kwargs.get("relationships", {}).keys(),
|
|
217
199
|
*ilamb_kwargs.get("alternate_vars", []),
|
|
218
200
|
*ilamb_kwargs.get("related_vars", []),
|
|
201
|
+
*ilamb_kwargs.get("relationships", {}).keys(),
|
|
219
202
|
)
|
|
220
203
|
}
|
|
221
204
|
),
|
|
222
205
|
FacetFilter(facets={"frequency": ("mon",)}),
|
|
223
206
|
FacetFilter(facets={"experiment_id": ("historical", "land-hist")}),
|
|
224
|
-
# Exclude unneeded snc tables
|
|
225
207
|
FacetFilter(facets={"table_id": ("ImonAnt", "ImonGre")}, keep=False),
|
|
226
208
|
),
|
|
227
209
|
constraints=(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
210
|
+
RequireFacets(
|
|
211
|
+
"variable_id",
|
|
212
|
+
(
|
|
213
|
+
self.variable_id,
|
|
214
|
+
*ilamb_kwargs.get("alternate_vars", []),
|
|
215
|
+
*ilamb_kwargs.get("related_vars", []),
|
|
216
|
+
),
|
|
217
|
+
operator="any",
|
|
218
|
+
),
|
|
219
|
+
*(
|
|
220
|
+
[
|
|
221
|
+
RequireFacets(
|
|
222
|
+
"variable_id",
|
|
223
|
+
required_facets=tuple(ilamb_kwargs.get("relationships", {}).keys()),
|
|
224
|
+
)
|
|
225
|
+
]
|
|
226
|
+
if "relationships" in ilamb_kwargs
|
|
227
|
+
else []
|
|
228
|
+
),
|
|
229
|
+
*(
|
|
230
|
+
(
|
|
231
|
+
AddSupplementaryDataset.from_defaults("areacella", SourceDatasetType.CMIP6),
|
|
232
|
+
AddSupplementaryDataset.from_defaults("sftlf", SourceDatasetType.CMIP6),
|
|
233
|
+
)
|
|
234
|
+
if registry_file == "ilamb"
|
|
235
|
+
else (
|
|
236
|
+
AddSupplementaryDataset.from_defaults("areacello", SourceDatasetType.CMIP6),
|
|
237
|
+
AddSupplementaryDataset.from_defaults("sftof", SourceDatasetType.CMIP6),
|
|
238
|
+
)
|
|
239
|
+
),
|
|
235
240
|
),
|
|
236
|
-
group_by=("experiment_id",),
|
|
241
|
+
group_by=("experiment_id", "source_id", "member_id", "grid_label"),
|
|
237
242
|
),
|
|
238
243
|
)
|
|
244
|
+
|
|
239
245
|
self.facets = (
|
|
240
246
|
"experiment_id",
|
|
241
247
|
"source_id",
|
|
@@ -257,12 +263,11 @@ class ILAMBStandard(Diagnostic):
|
|
|
257
263
|
"""
|
|
258
264
|
Run the ILAMB standard analysis.
|
|
259
265
|
"""
|
|
260
|
-
plt.rcParams.update({"figure.max_open_warning": 0})
|
|
261
266
|
_set_ilamb3_options(self.registry, self.registry_file)
|
|
262
267
|
ref_datasets = self.ilamb_data.datasets.set_index(self.ilamb_data.slug_column)
|
|
263
|
-
run.
|
|
264
|
-
ref_datasets,
|
|
268
|
+
run.run_single_block(
|
|
265
269
|
self.slug,
|
|
270
|
+
ref_datasets,
|
|
266
271
|
definition.datasets[SourceDatasetType.CMIP6].datasets,
|
|
267
272
|
definition.output_directory,
|
|
268
273
|
**self.ilamb_kwargs,
|
|
@@ -281,15 +286,91 @@ class ILAMBStandard(Diagnostic):
|
|
|
281
286
|
-------
|
|
282
287
|
An execution result object
|
|
283
288
|
"""
|
|
284
|
-
selectors = definition.datasets[SourceDatasetType.CMIP6].selector_dict()
|
|
285
289
|
_set_ilamb3_options(self.registry, self.registry_file)
|
|
286
|
-
|
|
290
|
+
# In ILAMB, scalars are saved in CSV files in the output directory. To
|
|
291
|
+
# be compatible with the REF system we will need to add the metadata
|
|
292
|
+
# that is associated with the execution group, called the selector.
|
|
287
293
|
df = _load_csv_and_merge(definition.output_directory)
|
|
288
|
-
|
|
294
|
+
selectors = definition.datasets[SourceDatasetType.CMIP6].selector_dict()
|
|
289
295
|
for key, value in selectors.items():
|
|
290
296
|
df[key] = value
|
|
291
|
-
metric_bundle
|
|
297
|
+
metric_bundle = CMECMetric.model_validate(_build_cmec_bundle(df))
|
|
298
|
+
|
|
299
|
+
# Add each png file plot to the output
|
|
300
|
+
output_bundle = CMECOutput.create_template()
|
|
301
|
+
for plotfile in definition.output_directory.glob("*.png"):
|
|
302
|
+
output_bundle[OutputCV.PLOTS.value][f"{plotfile}"] = {
|
|
303
|
+
OutputCV.FILENAME.value: f"{plotfile}",
|
|
304
|
+
OutputCV.LONG_NAME.value: _caption_from_filename(plotfile),
|
|
305
|
+
OutputCV.DESCRIPTION.value: "",
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
# Add the html page to the output
|
|
309
|
+
index_html = str(definition.to_output_path("index.html"))
|
|
310
|
+
output_bundle[OutputCV.HTML.value][index_html] = {
|
|
311
|
+
OutputCV.FILENAME.value: index_html,
|
|
312
|
+
OutputCV.LONG_NAME.value: "Results page",
|
|
313
|
+
OutputCV.DESCRIPTION.value: "Page displaying scalars and plots from the ILAMB execution.",
|
|
314
|
+
}
|
|
315
|
+
output_bundle[OutputCV.INDEX.value] = index_html
|
|
316
|
+
|
|
317
|
+
# Add series to the output based on the time traces we find in the
|
|
318
|
+
# output files
|
|
319
|
+
series = []
|
|
320
|
+
for ncfile in definition.output_directory.glob("*.nc"):
|
|
321
|
+
ds = xr.open_dataset(ncfile)
|
|
322
|
+
for name, da in ds.items():
|
|
323
|
+
# Only create series for 1d DataArray's with these dimensions
|
|
324
|
+
if not (da.ndim == 1 and set(da.dims).intersection(["time", "month"])):
|
|
325
|
+
continue
|
|
326
|
+
# Convert dimension values
|
|
327
|
+
attrs = {}
|
|
328
|
+
str_name = str(name)
|
|
329
|
+
index_name = str(da.dims[0])
|
|
330
|
+
index = ds[index_name].values.tolist()
|
|
331
|
+
if hasattr(index[0], "isoformat"):
|
|
332
|
+
index = [v.isoformat() for v in index]
|
|
333
|
+
if hasattr(index[0], "calendar"):
|
|
334
|
+
attrs["calendar"] = index[0].calendar
|
|
335
|
+
# Parse out some CVs
|
|
336
|
+
dimensions = {"metric": str_name, "source_id": ncfile.stem}
|
|
337
|
+
if "_" in str_name:
|
|
338
|
+
dimensions["region"] = str_name.split("_")[1]
|
|
339
|
+
series.append(
|
|
340
|
+
SeriesMetricValue(
|
|
341
|
+
dimensions=dimensions,
|
|
342
|
+
values=da.values.tolist(),
|
|
343
|
+
index=index,
|
|
344
|
+
index_name=index_name,
|
|
345
|
+
attributes=attrs,
|
|
346
|
+
)
|
|
347
|
+
)
|
|
292
348
|
|
|
293
349
|
return ExecutionResult.build_from_output_bundle(
|
|
294
|
-
definition, cmec_output_bundle=output_bundle, cmec_metric_bundle=metric_bundle
|
|
350
|
+
definition, cmec_output_bundle=output_bundle, cmec_metric_bundle=metric_bundle, series=series
|
|
295
351
|
)
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
def _caption_from_filename(filename: Path) -> str:
|
|
355
|
+
source, region, plot = filename.stem.split("_")
|
|
356
|
+
plot_texts = {
|
|
357
|
+
"bias": "bias",
|
|
358
|
+
"biasscore": "bias score",
|
|
359
|
+
"cycle": "annual cycle",
|
|
360
|
+
"cyclescore": "annual cycle score",
|
|
361
|
+
"mean": "period mean",
|
|
362
|
+
"rmse": "RMSE",
|
|
363
|
+
"rmsescore": "RMSE score",
|
|
364
|
+
"shift": "shift in maximum month",
|
|
365
|
+
"tmax": "maxmimum month",
|
|
366
|
+
"trace": "regional mean",
|
|
367
|
+
"taylor": "Taylor diagram",
|
|
368
|
+
}
|
|
369
|
+
if plot not in plot_texts:
|
|
370
|
+
return ""
|
|
371
|
+
caption = f"The {plot_texts.get(plot)}"
|
|
372
|
+
if source != "None":
|
|
373
|
+
caption += f" of {'the reference data' if source == 'Reference' else source}"
|
|
374
|
+
if region.lower() != "none":
|
|
375
|
+
caption += f" over the {ilr.Regions().get_name(region)} region."
|
|
376
|
+
return caption
|
|
@@ -3,17 +3,20 @@ from climate_ref_ilamb import provider as ilamb_provider
|
|
|
3
3
|
|
|
4
4
|
from climate_ref_core.diagnostics import Diagnostic
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
xfail_diagnostics = [
|
|
7
7
|
"ohc-noaa", # Missing sample data
|
|
8
8
|
]
|
|
9
|
+
skipped_diagnostics = []
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
diagnostics = [
|
|
11
13
|
pytest.param(
|
|
12
14
|
diagnostic,
|
|
13
15
|
id=diagnostic.slug,
|
|
14
|
-
marks=[
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
marks=[
|
|
17
|
+
*([pytest.mark.xfail(reason="Expected failure")] if diagnostic.slug in xfail_diagnostics else []),
|
|
18
|
+
*([pytest.mark.skip(reason="Problem test")] if diagnostic.slug in skipped_diagnostics else []),
|
|
19
|
+
],
|
|
17
20
|
)
|
|
18
21
|
for diagnostic in ilamb_provider.diagnostics()
|
|
19
22
|
]
|
|
@@ -13,18 +13,27 @@ def test_standard_site(cmip6_data_catalog, definition_factory):
|
|
|
13
13
|
diagnostic = ILAMBStandard(
|
|
14
14
|
registry_file="ilamb-test", metric_name="test-site-tas", sources={"tas": "ilamb/test/Site/tas.nc"}
|
|
15
15
|
)
|
|
16
|
-
ds = (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
_, ds = next(
|
|
17
|
+
iter(
|
|
18
|
+
cmip6_data_catalog[
|
|
19
|
+
(cmip6_data_catalog["experiment_id"] == "historical")
|
|
20
|
+
& (cmip6_data_catalog["variable_id"] == "tas")
|
|
21
|
+
].groupby("instance_id")
|
|
22
|
+
)
|
|
23
23
|
)
|
|
24
|
-
|
|
25
24
|
definition = definition_factory(
|
|
26
25
|
diagnostic=diagnostic,
|
|
27
|
-
cmip6=DatasetCollection(
|
|
26
|
+
cmip6=DatasetCollection(
|
|
27
|
+
ds,
|
|
28
|
+
"instance_id",
|
|
29
|
+
selector=(
|
|
30
|
+
("experiment_id", "historical"),
|
|
31
|
+
("variable_id", "tas"),
|
|
32
|
+
("source_id", "CanESM5"),
|
|
33
|
+
("member_id", "r1i1p1f1"),
|
|
34
|
+
("grid_label", "gn"),
|
|
35
|
+
),
|
|
36
|
+
),
|
|
28
37
|
)
|
|
29
38
|
definition.output_directory.mkdir(parents=True, exist_ok=True)
|
|
30
39
|
|
|
@@ -54,15 +63,28 @@ def test_standard_grid(cmip6_data_catalog, definition_factory):
|
|
|
54
63
|
sources={"gpp": "ilamb/test/Grid/gpp.nc"},
|
|
55
64
|
relationships={"pr": "ilamb/test/Grid/pr.nc"},
|
|
56
65
|
)
|
|
57
|
-
|
|
58
|
-
(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
_, ds = next(
|
|
67
|
+
iter(
|
|
68
|
+
cmip6_data_catalog[
|
|
69
|
+
(cmip6_data_catalog["experiment_id"] == "historical")
|
|
70
|
+
& ((cmip6_data_catalog["variable_id"] == "gpp") | (cmip6_data_catalog["variable_id"] == "pr"))
|
|
71
|
+
].groupby(["source_id", "member_id", "grid_label"])
|
|
72
|
+
)
|
|
73
|
+
)
|
|
62
74
|
|
|
63
75
|
definition = definition_factory(
|
|
64
76
|
diagnostic=diagnostic,
|
|
65
|
-
cmip6=DatasetCollection(
|
|
77
|
+
cmip6=DatasetCollection(
|
|
78
|
+
ds,
|
|
79
|
+
"instance_id",
|
|
80
|
+
selector=(
|
|
81
|
+
("experiment_id", "historical"),
|
|
82
|
+
("variable_id", "tas"),
|
|
83
|
+
("source_id", "CanESM5"),
|
|
84
|
+
("member_id", "r1i1p1f1"),
|
|
85
|
+
("grid_label", "gn"),
|
|
86
|
+
),
|
|
87
|
+
),
|
|
66
88
|
)
|
|
67
89
|
definition.output_directory.mkdir(parents=True, exist_ok=True)
|
|
68
90
|
|
|
@@ -129,17 +151,18 @@ def test_expected_executions():
|
|
|
129
151
|
),
|
|
130
152
|
}
|
|
131
153
|
executions = list(solve_executions(data_catalog, diagnostic, provider=ilamb_provider))
|
|
132
|
-
assert len(executions) ==
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
154
|
+
assert len(executions) == 2
|
|
155
|
+
assert executions[0].datasets[SourceDatasetType.CMIP6].selector == (
|
|
156
|
+
("experiment_id", "historical"),
|
|
157
|
+
("grid_label", "gn"),
|
|
158
|
+
("member_id", "r1i1p1f1"),
|
|
159
|
+
("source_id", "ACCESS-ESM1-5"),
|
|
160
|
+
)
|
|
136
161
|
assert executions[0].datasets[SourceDatasetType.CMIP6].datasets["variable_id"].tolist() == [
|
|
137
|
-
"cSoil",
|
|
138
162
|
"cSoil",
|
|
139
163
|
"areacella",
|
|
140
164
|
]
|
|
141
165
|
assert executions[0].datasets[SourceDatasetType.CMIP6].datasets["member_id"].tolist() == [
|
|
142
166
|
"r1i1p1f1",
|
|
143
|
-
"r2i1p1f1",
|
|
144
167
|
"r1i1p1f1",
|
|
145
168
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/dataset_registry/ilamb.txt
RENAMED
|
File without changes
|
{climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/dataset_registry/iomb.txt
RENAMED
|
File without changes
|
{climate_ref_ilamb-0.6.5 → climate_ref_ilamb-0.6.6}/src/climate_ref_ilamb/dataset_registry/test.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|