Skip to content

Commit

Permalink
test: adds integration tests with real processing using CMIP7 data re…
Browse files Browse the repository at this point in the history
…quest backend
  • Loading branch information
pgierz committed Dec 11, 2024
1 parent 48355df commit 2be4f67
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/configs/test_config_pi_uxarray_cmip7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pymorize:

Check warning on line 1 in tests/configs/test_config_pi_uxarray_cmip7.yaml

View workflow job for this annotation

GitHub Actions / check_format (3.9)

1:1 [document-start] missing document start "---"
warn_on_no_rule: False

Check warning on line 2 in tests/configs/test_config_pi_uxarray_cmip7.yaml

View workflow job for this annotation

GitHub Actions / check_format (3.9)

2:20 [truthy] truthy value should be one of [false, true]
parallel: False

Check warning on line 3 in tests/configs/test_config_pi_uxarray_cmip7.yaml

View workflow job for this annotation

GitHub Actions / check_format (3.9)

3:13 [truthy] truthy value should be one of [false, true]
general:
name: "pi_uxarray"
description: "This is a test configuration using the UXArray test data on PI Mesh"

Check warning on line 6 in tests/configs/test_config_pi_uxarray_cmip7.yaml

View workflow job for this annotation

GitHub Actions / check_format (3.9)

6:81 [line-length] line too long (84 > 80 characters)
maintainer: "pgierz"
email: "[email protected]"
cmor_version: "CMIP7"
mip: "CMIP"
frequency: "mon"
CMIP_Tables_Dir: "./CMIP7_DReq_Software/scripts/variable_info/"
rules:
- name: "temp"
experiment_id: "piControl"
output_directory: "./output"
source_id: "FESOM"
variant_label: "r1i1p1f1"
inputs:
- path: "REPLACE_ME"
pattern: "temp.fesom..*.nc"
cmor_variable: "thetao"
model_variable: "temp"
5 changes: 5 additions & 0 deletions tests/fixtures/config_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ def pi_uxarray_config():
return TEST_ROOT / "configs" / "test_config_pi_uxarray.yaml"


@pytest.fixture
def pi_uxarray_config_cmip7():
return TEST_ROOT / "configs" / "test_config_pi_uxarray_cmip7.yaml"


@pytest.fixture
def fesom_2p6_pimesh_esm_tools_config():
return TEST_ROOT / "configs" / "test_config_fesom_2p6_pimesh.yaml"
11 changes: 11 additions & 0 deletions tests/integration/test_uxarray_pi.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,14 @@ def test_process(pi_uxarray_config, pi_uxarray_data):
input["path"] = input["path"].replace("REPLACE_ME", str(pi_uxarray_data))
cmorizer = CMORizer.from_dict(cfg)
cmorizer.process()


def test_process_cmip7(pi_uxarray_config_cmip7, pi_uxarray_data):
logger.info(f"Processing {pi_uxarray_config_cmip7}")
with open(pi_uxarray_config_cmip7, "r") as f:
cfg = yaml.safe_load(f)
for rule in cfg["rules"]:
for input in rule["inputs"]:
input["path"] = input["path"].replace("REPLACE_ME", str(pi_uxarray_data))
cmorizer = CMORizer.from_dict(cfg)
cmorizer.process()

0 comments on commit 2be4f67

Please sign in to comment.