climate-ref-core 0.6.0__tar.gz → 0.6.1__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 (46) hide show
  1. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/PKG-INFO +1 -1
  2. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/pyproject.toml +1 -1
  3. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/exceptions.py +8 -0
  4. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/executor.py +9 -3
  5. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/.gitignore +0 -0
  6. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/LICENCE +0 -0
  7. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/NOTICE +0 -0
  8. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/README.md +0 -0
  9. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/__init__.py +0 -0
  10. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/constraints.py +0 -0
  11. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/dataset_registry.py +0 -0
  12. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/datasets.py +0 -0
  13. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/diagnostics.py +0 -0
  14. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/env.py +0 -0
  15. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/logging.py +0 -0
  16. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/metric_values/__init__.py +0 -0
  17. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/metric_values/typing.py +0 -0
  18. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/providers.py +0 -0
  19. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/py.typed +0 -0
  20. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/pycmec/README.md +0 -0
  21. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/pycmec/__init__.py +0 -0
  22. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/pycmec/controlled_vocabulary.py +0 -0
  23. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/pycmec/cv_cmip7_aft.yaml +0 -0
  24. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/pycmec/metric.py +0 -0
  25. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/src/climate_ref_core/pycmec/output.py +0 -0
  26. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/metric_values/test_typing.py +0 -0
  27. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/pycmec/cmec_testdata/cmec_metric_sample.json +0 -0
  28. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/pycmec/cmec_testdata/cmec_output_sample.json +0 -0
  29. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/pycmec/cmec_testdata/cv_sample.yaml +0 -0
  30. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/pycmec/cmec_testdata/test_metric_json_schema.yml +0 -0
  31. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/pycmec/cmec_testdata/test_output_json_schema.yml +0 -0
  32. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/pycmec/conftest.py +0 -0
  33. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/pycmec/test_cmec_metric.py +0 -0
  34. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/pycmec/test_cmec_output.py +0 -0
  35. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/pycmec/test_controlled_vocabulary.py +0 -0
  36. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_constraints.py +0 -0
  37. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_dataset_registry/test_dataset_registry.py +0 -0
  38. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_datasets/dataset_collection_hash.yml +0 -0
  39. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_datasets/dataset_collection_obs4mips_hash.yml +0 -0
  40. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_datasets/metric_dataset_hash.yml +0 -0
  41. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_datasets.py +0 -0
  42. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_exceptions.py +0 -0
  43. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_executor.py +0 -0
  44. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_logging.py +0 -0
  45. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_metrics.py +0 -0
  46. {climate_ref_core-0.6.0 → climate_ref_core-0.6.1}/tests/unit/test_providers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: climate-ref-core
3
- Version: 0.6.0
3
+ Version: 0.6.1
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.6.0"
3
+ version = "0.6.1"
4
4
  description = "Core library for the CMIP Rapid Evaluation Framework"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -53,3 +53,11 @@ class ExecutionError(RefException):
53
53
 
54
54
  def __init__(self, message: str) -> None:
55
55
  super().__init__(message)
56
+
57
+
58
+ class DiagnosticError(RefException):
59
+ """Error from diagnostic computing"""
60
+
61
+ def __init__(self, message: str, result: Any):
62
+ super().__init__(message)
63
+ self.result = result
@@ -9,7 +9,7 @@ from typing import TYPE_CHECKING, Any, Protocol, runtime_checkable
9
9
  from loguru import logger
10
10
 
11
11
  from climate_ref_core.diagnostics import ExecutionDefinition, ExecutionResult
12
- from climate_ref_core.exceptions import InvalidExecutorException
12
+ from climate_ref_core.exceptions import DiagnosticError, InvalidExecutorException
13
13
  from climate_ref_core.logging import redirect_logs
14
14
 
15
15
  if TYPE_CHECKING:
@@ -20,6 +20,7 @@ if TYPE_CHECKING:
20
20
  def execute_locally(
21
21
  definition: ExecutionDefinition,
22
22
  log_level: str,
23
+ raise_error: bool = False,
23
24
  ) -> ExecutionResult:
24
25
  """
25
26
  Run a diagnostic execution
@@ -46,10 +47,15 @@ def execute_locally(
46
47
 
47
48
  with redirect_logs(definition, log_level):
48
49
  return definition.diagnostic.run(definition=definition)
49
- except Exception:
50
+ except Exception as e:
50
51
  # If the diagnostic fails, we want to log the error and return a failure result
51
52
  logger.exception(f"Error running {definition.execution_slug()!r}")
52
- return ExecutionResult.build_from_failure(definition)
53
+ result = ExecutionResult.build_from_failure(definition)
54
+
55
+ if raise_error:
56
+ raise DiagnosticError(str(e), result) from e
57
+ else:
58
+ return result
53
59
 
54
60
 
55
61
  @runtime_checkable