climate-ref-ilamb 0.5.2__tar.gz → 0.5.3__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 (19) hide show
  1. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/PKG-INFO +1 -1
  2. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/pyproject.toml +1 -1
  3. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/src/climate_ref_ilamb/standard.py +19 -2
  4. climate_ref_ilamb-0.5.3/tests/integration/test_diagnostics.py +37 -0
  5. climate_ref_ilamb-0.5.2/tests/integration/test_diagnostics.py +0 -15
  6. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/.gitignore +0 -0
  7. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/LICENCE +0 -0
  8. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/NOTICE +0 -0
  9. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/README.md +0 -0
  10. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/src/climate_ref_ilamb/__init__.py +0 -0
  11. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/src/climate_ref_ilamb/configure/ilamb.yaml +0 -0
  12. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/src/climate_ref_ilamb/configure/iomb.yaml +0 -0
  13. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/src/climate_ref_ilamb/dataset_registry/ilamb.txt +0 -0
  14. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/src/climate_ref_ilamb/dataset_registry/iomb.txt +0 -0
  15. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/src/climate_ref_ilamb/dataset_registry/test.txt +0 -0
  16. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/src/climate_ref_ilamb/datasets.py +0 -0
  17. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/src/climate_ref_ilamb/py.typed +0 -0
  18. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/tests/unit/test_provider.py +0 -0
  19. {climate_ref_ilamb-0.5.2 → climate_ref_ilamb-0.5.3}/tests/unit/test_standard_metrics.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: climate-ref-ilamb
3
- Version: 0.5.2
3
+ Version: 0.5.3
4
4
  Summary: ILAMB diagnostic provider for the Rapid Evaluation Framework
5
5
  Author-email: Nathan Collier <nathaniel.collier@gmail.com>
6
6
  License: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "climate-ref-ilamb"
3
- version = "0.5.2"
3
+ version = "0.5.3"
4
4
  description = "ILAMB diagnostic provider for the Rapid Evaluation Framework"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Nathan Collier", email = "nathaniel.collier@gmail.com" }]
@@ -25,7 +25,7 @@ from climate_ref_ilamb.datasets import (
25
25
 
26
26
  def _build_cmec_bundle(name: str, df: pd.DataFrame) -> dict[str, Any]:
27
27
  """
28
- Build a CMEC boundle from information in the dataframe.
28
+ Build a CMEC bundle from information in the dataframe.
29
29
 
30
30
  TODO: Migrate to use pycmec when ready.
31
31
  TODO: Add plots and html output.
@@ -169,7 +169,7 @@ class ILAMBStandard(Diagnostic):
169
169
  dataset_registry_manager[self.registry_file],
170
170
  )
171
171
 
172
- def run(self, definition: ExecutionDefinition) -> ExecutionResult:
172
+ def execute(self, definition: ExecutionDefinition) -> None:
173
173
  """
174
174
  Run the ILAMB standard analysis.
175
175
  """
@@ -183,8 +183,25 @@ class ILAMBStandard(Diagnostic):
183
183
  definition.output_directory,
184
184
  **self.ilamb_kwargs,
185
185
  )
186
+
187
+ def build_execution_result(self, definition: ExecutionDefinition) -> ExecutionResult:
188
+ """
189
+ Build the diagnostic result after running ILAMB.
190
+
191
+ Parameters
192
+ ----------
193
+ definition
194
+ The definition of the diagnostic execution
195
+
196
+ Returns
197
+ -------
198
+ An execution result object
199
+ """
200
+ _set_ilamb3_options(self.registry, self.registry_file)
201
+
186
202
  df = _load_csv_and_merge(definition.output_directory)
187
203
  metric_bundle, output_bundle = _form_bundles(definition.key, df)
204
+
188
205
  return ExecutionResult.build_from_output_bundle(
189
206
  definition, cmec_output_bundle=output_bundle, cmec_metric_bundle=metric_bundle
190
207
  )
@@ -0,0 +1,37 @@
1
+ import pytest
2
+ from climate_ref_ilamb import provider as ilamb_provider
3
+
4
+ from climate_ref_core.diagnostics import Diagnostic
5
+
6
+ skipped_diagnostics = [
7
+ "csoil-hwsd2", # Incorrect time spans
8
+ "nbp-hoffman", # Incorrect time spans
9
+ ]
10
+
11
+ diagnostics = [
12
+ pytest.param(
13
+ diagnostic,
14
+ id=diagnostic.slug,
15
+ marks=[pytest.mark.xfail(reason="Expected failure")]
16
+ if diagnostic.slug in skipped_diagnostics
17
+ else [],
18
+ )
19
+ for diagnostic in ilamb_provider.diagnostics()
20
+ ]
21
+
22
+
23
+ @pytest.mark.slow
24
+ @pytest.mark.parametrize("diagnostic", diagnostics)
25
+ def test_diagnostics(diagnostic: Diagnostic, diagnostic_validation):
26
+ validator = diagnostic_validation(diagnostic)
27
+
28
+ definition = validator.get_definition()
29
+ validator.execute(definition)
30
+
31
+
32
+ @pytest.mark.parametrize("diagnostic", diagnostics)
33
+ def test_build_results(diagnostic: Diagnostic, diagnostic_validation):
34
+ validator = diagnostic_validation(diagnostic)
35
+
36
+ definition = validator.get_regression_definition()
37
+ validator.validate(definition)
@@ -1,15 +0,0 @@
1
- import pytest
2
- from climate_ref_ilamb import provider as ilamb_provider
3
-
4
- from climate_ref_core.diagnostics import Diagnostic
5
-
6
- diagnostics = [pytest.param(diagnostic, id=diagnostic.slug) for diagnostic in ilamb_provider.diagnostics()]
7
-
8
-
9
- @pytest.mark.slow
10
- @pytest.mark.parametrize("diagnostic", diagnostics)
11
- def test_diagnostics(diagnostic: Diagnostic, diagnostic_validation):
12
- if diagnostic.slug.startswith("thetao"):
13
- pytest.xfail("Missing data for thetao diagnostics")
14
-
15
- diagnostic_validation(diagnostic)