climate-ref-core 0.6.1__py3-none-any.whl → 0.6.3__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.
@@ -18,7 +18,7 @@ from rich.progress import track
18
18
 
19
19
  from climate_ref_core.env import env
20
20
 
21
- DATASET_URL = env.str("REF_DATASET_URL", default="https://pub-b093171261094c4ea9adffa01f94ee06.r2.dev")
21
+ DATASET_URL = env.str("REF_DATASET_URL", default="https://obs4ref.climate-ref.org")
22
22
 
23
23
 
24
24
  def _verify_hash_matches(fname: str | pathlib.Path, known_hash: str) -> bool:
@@ -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))
@@ -390,7 +390,13 @@ class CondaDiagnosticProvider(CommandLineDiagnosticProvider):
390
390
  If the command fails
391
391
 
392
392
  """
393
- self.create_env()
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 ruamel.yaml import YAML
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.1
3
+ Version: 0.6.3
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
@@ -1,24 +1,24 @@
1
1
  climate_ref_core/__init__.py,sha256=MtmPThF2F9_2UODEN6rt1x30LDxrHIZ0wyRN_wsHx5I,127
2
2
  climate_ref_core/constraints.py,sha256=QOqMh5jDBxdWTnQw2HNBizJQDF6Uu97rfJp9WudQWHc,11819
3
- climate_ref_core/dataset_registry.py,sha256=mkes7Pgz_zaS_t_BidiDzSd8dmqAvjx2MlgoFMAhn20,7192
3
+ climate_ref_core/dataset_registry.py,sha256=sQp2VT9xSVAaWsf0tF4E_VQxuEsvIxU2MZm5uNX1ynw,7172
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=aC_wohLCjOUarZM2VvpGdJzPvYdT31h_MRVbqVk-MIk,1633
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=by_ZtoLQgg9A60CbFor2-i5EixtZTZ0z8jQqOGRfvA8,12461
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=ThdTBsSmUemyXSQG5RycN31qp93LfqIyPqvI8x5cdLI,5114
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.1.dist-info/METADATA,sha256=fVjjH-4zZEbuoFw47Sqo1TRFAWwwiz6BZetTD88xQLE,2934
21
- climate_ref_core-0.6.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
- climate_ref_core-0.6.1.dist-info/licenses/LICENCE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
23
- climate_ref_core-0.6.1.dist-info/licenses/NOTICE,sha256=4qTlax9aX2-mswYJuVrLqJ9jK1IkN5kSBqfVvYLF3Ws,128
24
- climate_ref_core-0.6.1.dist-info/RECORD,,
20
+ climate_ref_core-0.6.3.dist-info/METADATA,sha256=e7WO6GoHzqhWcieMV3t0TlIXJkJVnVI9EfLtM9wr_9k,2930
21
+ climate_ref_core-0.6.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
+ climate_ref_core-0.6.3.dist-info/licenses/LICENCE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
23
+ climate_ref_core-0.6.3.dist-info/licenses/NOTICE,sha256=4qTlax9aX2-mswYJuVrLqJ9jK1IkN5kSBqfVvYLF3Ws,128
24
+ climate_ref_core-0.6.3.dist-info/RECORD,,