climate-ref-ilamb 0.8.0__py3-none-any.whl → 0.9.0__py3-none-any.whl
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/__init__.py +53 -2
- {climate_ref_ilamb-0.8.0.dist-info → climate_ref_ilamb-0.9.0.dist-info}/METADATA +2 -1
- {climate_ref_ilamb-0.8.0.dist-info → climate_ref_ilamb-0.9.0.dist-info}/RECORD +7 -7
- {climate_ref_ilamb-0.8.0.dist-info → climate_ref_ilamb-0.9.0.dist-info}/WHEEL +0 -0
- {climate_ref_ilamb-0.8.0.dist-info → climate_ref_ilamb-0.9.0.dist-info}/entry_points.txt +0 -0
- {climate_ref_ilamb-0.8.0.dist-info → climate_ref_ilamb-0.9.0.dist-info}/licenses/LICENCE +0 -0
- {climate_ref_ilamb-0.8.0.dist-info → climate_ref_ilamb-0.9.0.dist-info}/licenses/NOTICE +0 -0
climate_ref_ilamb/__init__.py
CHANGED
|
@@ -5,18 +5,69 @@ This module provides a diagnostics provider for ILAMB, a tool for evaluating
|
|
|
5
5
|
climate models against observations.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
8
10
|
import importlib.metadata
|
|
9
11
|
import importlib.resources
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from typing import TYPE_CHECKING
|
|
10
14
|
|
|
15
|
+
import pooch
|
|
11
16
|
import yaml
|
|
17
|
+
from loguru import logger
|
|
12
18
|
|
|
13
|
-
from climate_ref_core.dataset_registry import
|
|
19
|
+
from climate_ref_core.dataset_registry import (
|
|
20
|
+
DATASET_URL,
|
|
21
|
+
dataset_registry_manager,
|
|
22
|
+
fetch_all_files,
|
|
23
|
+
validate_registry_cache,
|
|
24
|
+
)
|
|
14
25
|
from climate_ref_core.providers import DiagnosticProvider
|
|
15
26
|
from climate_ref_ilamb.standard import ILAMBStandard
|
|
16
27
|
|
|
28
|
+
if TYPE_CHECKING:
|
|
29
|
+
from climate_ref.config import Config
|
|
30
|
+
|
|
17
31
|
__version__ = importlib.metadata.version("climate-ref-ilamb")
|
|
18
32
|
|
|
19
|
-
|
|
33
|
+
# Registry names used by ILAMB
|
|
34
|
+
_REGISTRY_NAMES = ("ilamb-test", "ilamb", "iomb")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ILAMBProvider(DiagnosticProvider):
|
|
38
|
+
"""Provider for ILAMB diagnostics."""
|
|
39
|
+
|
|
40
|
+
def fetch_data(self, config: Config) -> None:
|
|
41
|
+
"""Fetch ILAMB reference data from all registries."""
|
|
42
|
+
for name in _REGISTRY_NAMES:
|
|
43
|
+
registry = dataset_registry_manager[name]
|
|
44
|
+
fetch_all_files(registry, name, output_dir=None)
|
|
45
|
+
|
|
46
|
+
def validate_setup(self, config: Config) -> bool:
|
|
47
|
+
"""Validate that all ILAMB data is cached with correct checksums."""
|
|
48
|
+
all_errors: list[str] = []
|
|
49
|
+
for name in _REGISTRY_NAMES:
|
|
50
|
+
registry = dataset_registry_manager[name]
|
|
51
|
+
errors = validate_registry_cache(registry, name)
|
|
52
|
+
all_errors.extend(errors)
|
|
53
|
+
|
|
54
|
+
if all_errors:
|
|
55
|
+
for error in all_errors:
|
|
56
|
+
logger.error(f"ILAMB validation failed: {error}")
|
|
57
|
+
logger.error(
|
|
58
|
+
f"Data for {self.slug} is missing or corrupted. "
|
|
59
|
+
f"Please run `ref providers setup --provider {self.slug}` to fetch data."
|
|
60
|
+
)
|
|
61
|
+
return False
|
|
62
|
+
return True
|
|
63
|
+
|
|
64
|
+
def get_data_path(self) -> Path | None:
|
|
65
|
+
"""Get the path where ILAMB data is cached."""
|
|
66
|
+
# All ILAMB registries use the same cache
|
|
67
|
+
return Path(pooch.os_cache("climate_ref"))
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
provider = ILAMBProvider("ILAMB", __version__)
|
|
20
71
|
|
|
21
72
|
# Register some datasets
|
|
22
73
|
dataset_registry_manager.register(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: climate-ref-ilamb
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
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
|
|
@@ -21,6 +21,7 @@ Requires-Python: >=3.11
|
|
|
21
21
|
Requires-Dist: climate-ref-core
|
|
22
22
|
Requires-Dist: ilamb3>=2025.9.9
|
|
23
23
|
Requires-Dist: scipy<1.16
|
|
24
|
+
Requires-Dist: xarray<2025.11
|
|
24
25
|
Description-Content-Type: text/markdown
|
|
25
26
|
|
|
26
27
|
# climate-ref-ilamb
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
climate_ref_ilamb/__init__.py,sha256=
|
|
1
|
+
climate_ref_ilamb/__init__.py,sha256=bVJanhNTUkTAMhzK3qcDwmAR3_6saRgw4nHu-7XgLpY,3025
|
|
2
2
|
climate_ref_ilamb/datasets.py,sha256=MVCt1pxV5dIfYLm6huC0BZWP5stCamYNwXzc7kKW5AI,799
|
|
3
3
|
climate_ref_ilamb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
climate_ref_ilamb/standard.py,sha256=oz1J6lbjg0kqG2vkTgSIrd_t7yDud1HiLIILeStL5Ig,17873
|
|
@@ -7,9 +7,9 @@ climate_ref_ilamb/configure/iomb.yaml,sha256=AQ4MZFDeD4Sw-yDnLb4C-ID2JFk9jfhk_2U
|
|
|
7
7
|
climate_ref_ilamb/dataset_registry/ilamb.txt,sha256=_zqrq-Sa-0NTjPDFX6nQIeUalEc7tPrKr_CssOBlseg,1030
|
|
8
8
|
climate_ref_ilamb/dataset_registry/iomb.txt,sha256=b95CUBYEGfeoPyRGx_E267c-2GF-E_lc4XeFkNSOJMo,375
|
|
9
9
|
climate_ref_ilamb/dataset_registry/test.txt,sha256=gBjUJ6W-crghYqKN0QOFmjyqpMxKK50dU3SYTuIA6jM,206
|
|
10
|
-
climate_ref_ilamb-0.
|
|
11
|
-
climate_ref_ilamb-0.
|
|
12
|
-
climate_ref_ilamb-0.
|
|
13
|
-
climate_ref_ilamb-0.
|
|
14
|
-
climate_ref_ilamb-0.
|
|
15
|
-
climate_ref_ilamb-0.
|
|
10
|
+
climate_ref_ilamb-0.9.0.dist-info/METADATA,sha256=MLQouX-PfRrJhDXkQMwKwJuQ8TGLzsQMcuXjq-6XyE0,2372
|
|
11
|
+
climate_ref_ilamb-0.9.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
12
|
+
climate_ref_ilamb-0.9.0.dist-info/entry_points.txt,sha256=SnRhJk7KRiGd3jL4OMA2SId5p838T95kGcVrr3wtZAQ,59
|
|
13
|
+
climate_ref_ilamb-0.9.0.dist-info/licenses/LICENCE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
14
|
+
climate_ref_ilamb-0.9.0.dist-info/licenses/NOTICE,sha256=4qTlax9aX2-mswYJuVrLqJ9jK1IkN5kSBqfVvYLF3Ws,128
|
|
15
|
+
climate_ref_ilamb-0.9.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|