climate-ref-core 0.19.0__tar.gz → 0.19.2__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.
Files changed (100) hide show
  1. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/PKG-INFO +1 -1
  2. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/pyproject.toml +1 -1
  3. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/esgf/base.py +5 -2
  4. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/esgf/cmip6.py +1 -0
  5. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/esgf/obs4mips.py +3 -15
  6. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/esgf/test_base.py +2 -1
  7. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/esgf/test_obs4mips.py +2 -5
  8. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/.gitignore +0 -0
  9. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/LICENCE +0 -0
  10. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/NOTICE +0 -0
  11. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/README.md +0 -0
  12. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/__init__.py +0 -0
  13. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/cmip6_to_cmip7.py +0 -0
  14. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/cmor.py +0 -0
  15. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/constraints.py +0 -0
  16. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/data/cmip6_cmip7_variable_map.json +0 -0
  17. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/data.py +0 -0
  18. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/dataset_registry.py +0 -0
  19. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/datasets.py +0 -0
  20. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/diagnostics.py +0 -0
  21. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/env.py +0 -0
  22. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/esgf/__init__.py +0 -0
  23. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/esgf/cmip7.py +0 -0
  24. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/esgf/fetcher.py +0 -0
  25. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/esgf/registry.py +0 -0
  26. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/esmvaltool_reference.py +0 -0
  27. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/exceptions.py +0 -0
  28. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/executor.py +0 -0
  29. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/logging.py +0 -0
  30. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/metric_values/__init__.py +0 -0
  31. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/metric_values/typing.py +0 -0
  32. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/output_files.py +0 -0
  33. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/paths.py +0 -0
  34. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/providers.py +0 -0
  35. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/py.typed +0 -0
  36. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/pycmec/README.md +0 -0
  37. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/pycmec/__init__.py +0 -0
  38. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/pycmec/controlled_vocabulary.py +0 -0
  39. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/pycmec/cv_cmip7_aft.yaml +0 -0
  40. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/pycmec/metric.py +0 -0
  41. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/pycmec/output.py +0 -0
  42. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/reference_data.py +0 -0
  43. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/regression/__init__.py +0 -0
  44. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/regression/_quantise.py +0 -0
  45. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/regression/capture.py +0 -0
  46. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/regression/compare.py +0 -0
  47. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/regression/gate.py +0 -0
  48. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/regression/manifest.py +0 -0
  49. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/regression/report_store.py +0 -0
  50. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/regression/store.py +0 -0
  51. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/resources.py +0 -0
  52. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/serialisation.py +0 -0
  53. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/source_types.py +0 -0
  54. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/summary.py +0 -0
  55. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/src/climate_ref_core/testing.py +0 -0
  56. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/integration/test_resource_measurement.py +0 -0
  57. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/esgf/test_cmip6.py +0 -0
  58. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/esgf/test_cmip7.py +0 -0
  59. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/esgf/test_fetcher.py +0 -0
  60. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/esgf/test_registry.py +0 -0
  61. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/metric_values/test_typing.py +0 -0
  62. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/pycmec/cmec_testdata/cmec_metric_sample.json +0 -0
  63. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/pycmec/cmec_testdata/cmec_output_sample.json +0 -0
  64. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/pycmec/cmec_testdata/cv_sample.yaml +0 -0
  65. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/pycmec/cmec_testdata/test_metric_json_schema.yml +0 -0
  66. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/pycmec/cmec_testdata/test_output_json_schema.yml +0 -0
  67. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/pycmec/conftest.py +0 -0
  68. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/pycmec/test_cmec_metric.py +0 -0
  69. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/pycmec/test_cmec_output.py +0 -0
  70. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/pycmec/test_controlled_vocabulary.py +0 -0
  71. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/regression/test_capture.py +0 -0
  72. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/regression/test_compare.py +0 -0
  73. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/regression/test_gate.py +0 -0
  74. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/regression/test_manifest.py +0 -0
  75. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/regression/test_quantise.py +0 -0
  76. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/regression/test_report_store.py +0 -0
  77. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/regression/test_store.py +0 -0
  78. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_cmip6_to_cmip7.py +0 -0
  79. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_cmor.py +0 -0
  80. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_constraints.py +0 -0
  81. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_data.py +0 -0
  82. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_dataset_registry/test_dataset_registry.py +0 -0
  83. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_datasets/dataset_collection_hash.yml +0 -0
  84. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_datasets/dataset_collection_obs4mips_hash.yml +0 -0
  85. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_datasets/execution_dataset_hash.yml +0 -0
  86. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_datasets.py +0 -0
  87. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_diagnostics.py +0 -0
  88. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_esmvaltool_reference.py +0 -0
  89. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_exceptions.py +0 -0
  90. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_executor.py +0 -0
  91. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_logging.py +0 -0
  92. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_output_files.py +0 -0
  93. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_packaging.py +0 -0
  94. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_paths.py +0 -0
  95. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_providers.py +0 -0
  96. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_reference_data.py +0 -0
  97. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_resources.py +0 -0
  98. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_serialisation.py +0 -0
  99. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_summary.py +0 -0
  100. {climate_ref_core-0.19.0 → climate_ref_core-0.19.2}/tests/unit/test_testing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: climate-ref-core
3
- Version: 0.19.0
3
+ Version: 0.19.2
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "climate-ref-core"
3
- version = "0.19.0"
3
+ version = "0.19.2"
4
4
  description = "Core library for the CMIP Rapid Evaluation Framework"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -165,6 +165,7 @@ class IntakeESGFMixin:
165
165
  Mixin that fetches datasets from ESGF using intake-esgf.
166
166
 
167
167
  Subclasses must define:
168
+ - project: str
168
169
  - facets: dict[str, str | tuple[str, ...]]
169
170
  - remove_ensembles: bool
170
171
  - time_span: tuple[str, str] | None
@@ -174,6 +175,8 @@ class IntakeESGFMixin:
174
175
  """
175
176
 
176
177
  slug: str
178
+ project: str
179
+ """ESGF project to search, always sent because intake-esgf's default varies by release."""
177
180
  facets: dict[str, str | tuple[str, ...]]
178
181
  remove_ensembles: bool
179
182
  time_span: tuple[str, str] | None
@@ -215,7 +218,7 @@ class IntakeESGFMixin:
215
218
 
216
219
  def fetch_datasets(self) -> pd.DataFrame:
217
220
  """Fetch dataset metadata from ESGF."""
218
- facets: dict[str, Any] = dict(self.facets)
221
+ facets: dict[str, Any] = {"project": self.project, **self.facets}
219
222
 
220
223
  if self.pinned_instance_ids:
221
224
  # Ask for the pinned datasets by id as the declared facets may now
@@ -223,7 +226,7 @@ class IntakeESGFMixin:
223
226
  # index is read rather than which datasets match.
224
227
  logger.info(f"Resolving {len(self.pinned_instance_ids)} pinned datasets for {self.slug}")
225
228
  facets = {
226
- **({"project": facets["project"]} if "project" in facets else {}),
229
+ "project": facets["project"],
227
230
  "instance_id": list(self.pinned_instance_ids),
228
231
  # A pin holds even once a newer version of the dataset has been published
229
232
  "latest": [True, False],
@@ -46,6 +46,7 @@ class CMIP6Request(IntakeESGFMixin):
46
46
  """
47
47
 
48
48
  source_type = "CMIP6"
49
+ project = "CMIP6"
49
50
 
50
51
  cmip6_path_items = (
51
52
  "mip_era",
@@ -4,15 +4,10 @@ Obs4MIPs dataset request implementation.
4
4
 
5
5
  from __future__ import annotations
6
6
 
7
- from typing import TYPE_CHECKING, Any
8
-
9
- import pandas as pd
7
+ from typing import Any
10
8
 
11
9
  from climate_ref_core.esgf.base import IntakeESGFMixin
12
10
 
13
- if TYPE_CHECKING:
14
- pass
15
-
16
11
 
17
12
  class Obs4MIPsRequest(IntakeESGFMixin):
18
13
  """
@@ -22,6 +17,7 @@ class Obs4MIPsRequest(IntakeESGFMixin):
22
17
  """
23
18
 
24
19
  source_type = "obs4MIPs"
20
+ project = "obs4MIPs"
25
21
 
26
22
  obs4mips_path_items = (
27
23
  "activity_id",
@@ -71,7 +67,7 @@ class Obs4MIPsRequest(IntakeESGFMixin):
71
67
  Optional time range filter (start, end) in YYYY-MM format
72
68
  """
73
69
  self.slug = slug
74
- self.facets = {"project": "obs4MIPs", **facets}
70
+ self.facets = facets
75
71
  self.remove_ensembles = remove_ensembles
76
72
  self.time_span = time_span
77
73
 
@@ -82,13 +78,5 @@ class Obs4MIPsRequest(IntakeESGFMixin):
82
78
  if key not in self.avail_facets:
83
79
  raise ValueError(f"Filename path {key!r} not in available facets")
84
80
 
85
- def fetch_datasets(self) -> pd.DataFrame:
86
- """Fetch dataset metadata from ESGF with project=obs4MIPs."""
87
- # Ensure project facet is set to obs4MIPs
88
- if "project" not in self.facets:
89
- self.facets["project"] = "obs4MIPs"
90
-
91
- return super().fetch_datasets()
92
-
93
81
  def __repr__(self) -> str:
94
82
  return f"Obs4MIPsRequest(slug={self.slug!r}, facets={self.facets!r})"
@@ -142,7 +142,7 @@ class TestIntakeESGFMixin:
142
142
  with patch("climate_ref_core.esgf.base.ESGFCatalog", return_value=mock_cat):
143
143
  result = request.fetch_datasets()
144
144
 
145
- mock_cat.search.assert_called_once_with(source_id="ACCESS-ESM1-5", variable_id="tas")
145
+ mock_cat.search.assert_called_once_with(project="CMIP6", source_id="ACCESS-ESM1-5", variable_id="tas")
146
146
  assert "key" in result.columns
147
147
  assert "files" in result.columns
148
148
 
@@ -324,6 +324,7 @@ class TestIntakeESGFMixin:
324
324
  pinned.fetch_datasets()
325
325
 
326
326
  mock_cat.search.assert_called_once_with(
327
+ project="CMIP6",
327
328
  instance_id=["CMIP6.CMIP.CSIRO.ACCESS-ESM1-5.historical.r1i1p1f1.Amon.tas.gn.v1"],
328
329
  # A pin holds even once a newer version has been published
329
330
  latest=[True, False],
@@ -15,11 +15,8 @@ class TestObs4MIPsRequest:
15
15
  facets={"source_id": "GPCP-SG", "variable_id": "pr"},
16
16
  )
17
17
  assert request.slug == "test-obs"
18
- assert request.facets == {
19
- "project": "obs4MIPs",
20
- "source_id": "GPCP-SG",
21
- "variable_id": "pr",
22
- }
18
+ assert request.facets == {"source_id": "GPCP-SG", "variable_id": "pr"}
19
+ assert request.project == "obs4MIPs"
23
20
  assert request.remove_ensembles is False
24
21
  assert request.time_span is None
25
22
  assert request.source_type == "obs4MIPs"