climate-ref-core 0.6.1__py3-none-any.whl → 0.6.2__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_core/exceptions.py +6 -0
- climate_ref_core/providers.py +7 -1
- climate_ref_core/pycmec/controlled_vocabulary.py +2 -5
- {climate_ref_core-0.6.1.dist-info → climate_ref_core-0.6.2.dist-info}/METADATA +2 -2
- {climate_ref_core-0.6.1.dist-info → climate_ref_core-0.6.2.dist-info}/RECORD +8 -8
- {climate_ref_core-0.6.1.dist-info → climate_ref_core-0.6.2.dist-info}/WHEEL +0 -0
- {climate_ref_core-0.6.1.dist-info → climate_ref_core-0.6.2.dist-info}/licenses/LICENCE +0 -0
- {climate_ref_core-0.6.1.dist-info → climate_ref_core-0.6.2.dist-info}/licenses/NOTICE +0 -0
climate_ref_core/exceptions.py
CHANGED
|
@@ -60,4 +60,10 @@ class DiagnosticError(RefException):
|
|
|
60
60
|
|
|
61
61
|
def __init__(self, message: str, result: Any):
|
|
62
62
|
super().__init__(message)
|
|
63
|
+
self.message = message
|
|
63
64
|
self.result = result
|
|
65
|
+
|
|
66
|
+
# need for serialization of parsl
|
|
67
|
+
def __reduce__(self) -> tuple[type["DiagnosticError"], tuple[str, Any]]:
|
|
68
|
+
# Return a tuple: (callable, args_tuple_for_reconstruction)
|
|
69
|
+
return (self.__class__, (self.message, self.result))
|
climate_ref_core/providers.py
CHANGED
|
@@ -390,7 +390,13 @@ class CondaDiagnosticProvider(CommandLineDiagnosticProvider):
|
|
|
390
390
|
If the command fails
|
|
391
391
|
|
|
392
392
|
"""
|
|
393
|
-
self.
|
|
393
|
+
if not self.env_path.exists():
|
|
394
|
+
msg = (
|
|
395
|
+
f"Conda environment for provider `{self.slug}` not available at "
|
|
396
|
+
f"{self.env_path}. Please install it by running the command "
|
|
397
|
+
f"`ref providers create-env --provider {self.slug}`"
|
|
398
|
+
)
|
|
399
|
+
raise RuntimeError(msg)
|
|
394
400
|
|
|
395
401
|
cmd = [
|
|
396
402
|
f"{self.get_conda_exe(update=False)}",
|
|
@@ -4,14 +4,11 @@ from typing import Any
|
|
|
4
4
|
from attrs import field, frozen, validators
|
|
5
5
|
from cattrs import Converter, transform_error
|
|
6
6
|
from loguru import logger
|
|
7
|
-
from
|
|
7
|
+
from yaml import safe_load
|
|
8
8
|
|
|
9
9
|
from climate_ref_core.exceptions import ResultValidationError
|
|
10
10
|
from climate_ref_core.pycmec.metric import CMECMetric
|
|
11
11
|
|
|
12
|
-
yaml = YAML()
|
|
13
|
-
|
|
14
|
-
|
|
15
12
|
RESERVED_DIMENSION_NAMES = {"attributes", "json_structure", "created_at", "updated_at", "value", "id"}
|
|
16
13
|
"""
|
|
17
14
|
These names are reserved for internal use and should not be used as dimension names.
|
|
@@ -164,9 +161,9 @@ class CV:
|
|
|
164
161
|
|
|
165
162
|
"""
|
|
166
163
|
convertor = Converter(forbid_extra_keys=True)
|
|
167
|
-
contents = yaml.load(pathlib.Path(filename))
|
|
168
164
|
|
|
169
165
|
try:
|
|
166
|
+
contents = safe_load(pathlib.Path(filename).read_text(encoding="utf-8"))
|
|
170
167
|
return convertor.structure(contents, CV)
|
|
171
168
|
except Exception as exc:
|
|
172
169
|
logger.error(f"Error loading CV from {filename}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: climate-ref-core
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.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
|
|
@@ -26,9 +26,9 @@ Requires-Dist: numpy>=1.25.0
|
|
|
26
26
|
Requires-Dist: pandas>=2.1.0
|
|
27
27
|
Requires-Dist: pooch<2,>=1.8.0
|
|
28
28
|
Requires-Dist: pydantic>=2.10.6
|
|
29
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
29
30
|
Requires-Dist: requests
|
|
30
31
|
Requires-Dist: rich
|
|
31
|
-
Requires-Dist: ruamel-yaml>=0.18
|
|
32
32
|
Requires-Dist: setuptools>=75.8.0
|
|
33
33
|
Requires-Dist: typing-extensions
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
@@ -4,21 +4,21 @@ climate_ref_core/dataset_registry.py,sha256=mkes7Pgz_zaS_t_BidiDzSd8dmqAvjx2Mlgo
|
|
|
4
4
|
climate_ref_core/datasets.py,sha256=TK50WQwTfbase26s8wPEGEN1BwcedrOd8nk6IlEf3Ww,6124
|
|
5
5
|
climate_ref_core/diagnostics.py,sha256=5KCtHuhToSpATqjW4HBi56PsOxT5WX4VkqoZPUvYR60,18769
|
|
6
6
|
climate_ref_core/env.py,sha256=Ph2dejVxTELfP3bL0xES086WLGvV5H6KvsOwCkL6m-k,753
|
|
7
|
-
climate_ref_core/exceptions.py,sha256=
|
|
7
|
+
climate_ref_core/exceptions.py,sha256=7Mkz22P-kbiL-ZevAhlOuQaaeTio6zpwE9YA45OTGvs,1909
|
|
8
8
|
climate_ref_core/executor.py,sha256=QiVOca-d9JxKIktQIinQQYZGr3ecV5mL3nvUwCdMiJQ,5372
|
|
9
9
|
climate_ref_core/logging.py,sha256=cg6CK2DHGjyLaoRJm75p-Ja82hnVhBBQ4riOKk3l9XY,7063
|
|
10
|
-
climate_ref_core/providers.py,sha256=
|
|
10
|
+
climate_ref_core/providers.py,sha256=Gq2RWBp_GJZG8tUMoRMVL-UJ_ugTYtvWHEqwMK9JHt8,12773
|
|
11
11
|
climate_ref_core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
climate_ref_core/metric_values/__init__.py,sha256=aHfwRrqzLOmmaBKf1-4q97DnHb8KwmW0Dhwd79ZQiNQ,634
|
|
13
13
|
climate_ref_core/metric_values/typing.py,sha256=2DpzmjqQ7tqOPAyjthZ_O14c0-MhiYt-A_n9p6-bOao,1903
|
|
14
14
|
climate_ref_core/pycmec/README.md,sha256=PzkovlPpsXqFopsYzz5GRvCAipNRGO1Wo-0gc17qr2Y,36
|
|
15
15
|
climate_ref_core/pycmec/__init__.py,sha256=hXvKGEJQWyAp1i-ndr3D4zuYxkRhcR2LfXgFXlhYOk4,28
|
|
16
|
-
climate_ref_core/pycmec/controlled_vocabulary.py,sha256=
|
|
16
|
+
climate_ref_core/pycmec/controlled_vocabulary.py,sha256=_GZ2Y6KAYF12I3IS27g8YdFBAcAONyGAhpucQ4oEcOA,5128
|
|
17
17
|
climate_ref_core/pycmec/cv_cmip7_aft.yaml,sha256=gx5QyW88pZQVUfiYXmsJtJO6AJg6NbIZgdU4vDIa3fE,4390
|
|
18
18
|
climate_ref_core/pycmec/metric.py,sha256=zymXoutnjbdcxvG_fMJugFLLcBrfSPG0XoV-2tA0ujA,18499
|
|
19
19
|
climate_ref_core/pycmec/output.py,sha256=4-RQ439sfgNLeQZVDPB1pewF_kTwX7nCK0Z4U6bvbd0,5709
|
|
20
|
-
climate_ref_core-0.6.
|
|
21
|
-
climate_ref_core-0.6.
|
|
22
|
-
climate_ref_core-0.6.
|
|
23
|
-
climate_ref_core-0.6.
|
|
24
|
-
climate_ref_core-0.6.
|
|
20
|
+
climate_ref_core-0.6.2.dist-info/METADATA,sha256=TgifPLfIx9XtegPkLFv-aJ1MZuCr6xbMySuMuIaXYBU,2930
|
|
21
|
+
climate_ref_core-0.6.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
22
|
+
climate_ref_core-0.6.2.dist-info/licenses/LICENCE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
23
|
+
climate_ref_core-0.6.2.dist-info/licenses/NOTICE,sha256=4qTlax9aX2-mswYJuVrLqJ9jK1IkN5kSBqfVvYLF3Ws,128
|
|
24
|
+
climate_ref_core-0.6.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|