Skip to content

Commit

Permalink
Make some tests depend on eccodes version (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandorkertesz authored Sep 2, 2024
1 parent fb8a720 commit 973c436
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/earthkit/data/utils/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ def check_clone_kwargs(self, **kwargs):
kwargs.pop("headers_only", None)
return kwargs

def has_Ni_Nj_in_geo_namespace(self):
return self._version >= (2, 37, 0)

@property
def versions(self):
return f"ecCodes: {self._version} eccodes-python: {self._py_version}"
Expand Down
6 changes: 6 additions & 0 deletions tests/array_fieldlist/test_numpy_fs_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def test_array_fl_dump():
},
]

from earthkit.data.utils.message import ECC_FEATURES

if not ECC_FEATURES.has_Ni_Nj_in_geo_namespace():
ref[1]["data"].pop("Ni")
ref[1]["data"].pop("Nj")

assert len(r) == len(namespaces)
assert isinstance(r, list)
for d in r:
Expand Down
6 changes: 6 additions & 0 deletions tests/grib/test_grib_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,12 @@ def test_grib_dump(fl_type, array_backend):
},
]

from earthkit.data.utils.message import ECC_FEATURES

if not ECC_FEATURES.has_Ni_Nj_in_geo_namespace():
ref[1]["data"].pop("Ni")
ref[1]["data"].pop("Nj")

assert len(r) == len(namespaces)
assert isinstance(r, list)
for d in r:
Expand Down

0 comments on commit 973c436

Please sign in to comment.