Skip to content

Commit

Permalink
valid_month, and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyCMWF committed Jul 17, 2024
1 parent fb5eb09 commit ba56258
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Binary file added tests/sample-data/cams-egg4-monthly.grib
Binary file not shown.
Binary file modified tests/sample-data/era5-levels-members.nc
Binary file not shown.
9 changes: 9 additions & 0 deletions tests/test_50_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,12 @@ def test_dataset_missing_field_values() -> None:
t2 = res.variables["t2m"]
assert np.isclose(np.nanmean(t2[0, :, :]), 268.375)
assert np.isclose(np.nanmean(t2[1, :, :]), 270.716)


def test_valid_month_time_dim() -> None:

test_file = os.path.join(SAMPLE_DATA_FOLDER, "cams-egg4-monthly.grib")
ds = xr.open_dataset(test_file, time_dims=["valid_month"])

assert "valid_month" in ds.dims

0 comments on commit ba56258

Please sign in to comment.