From d91d4d6fe67b4a767358d01f13c4217023835c87 Mon Sep 17 00:00:00 2001 From: EddyCMWF Date: Fri, 21 Jun 2024 14:42:33 +0100 Subject: [PATCH] remove vertical encode_cf change as too hard coded into system --- cfgrib/dataset.py | 3 +-- tests/test_30_dataset.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cfgrib/dataset.py b/cfgrib/dataset.py index d87f1b53..f4054d1c 100644 --- a/cfgrib/dataset.py +++ b/cfgrib/dataset.py @@ -463,8 +463,7 @@ def encode_cf_first(data_var_attrs, encode_cf=("parameter", "time"), time_dims=( raise ValueError("time_dims %r not a subset of %r" % (time_dims, ALL_REF_TIME_KEYS)) else: coords_map.extend(DATA_TIME_KEYS) - if "level" in encode_cf: - coords_map.extend(VERTICAL_KEYS) + coords_map.extend(VERTICAL_KEYS) coords_map.extend(SPECTRA_KEYS) return coords_map diff --git a/tests/test_30_dataset.py b/tests/test_30_dataset.py index 83f0392f..08329b5a 100644 --- a/tests/test_30_dataset.py +++ b/tests/test_30_dataset.py @@ -135,7 +135,7 @@ def test_build_dataset_components_ignore_keys() -> None: stream = messages.FileStream(TEST_DATA_UKMO, "warn") index = dataset.open_fileindex(stream, messages.DEFAULT_INDEXPATH, dataset.INDEX_KEYS) assert "subCentre" in index.index_keys - index = dataset.open_fileindex(stream, messages.DEFAULT_INDEXPATH, index_keys, ignore_keys=["subCentre"]) + index = dataset.open_fileindex(stream, messages.DEFAULT_INDEXPATH, dataset.INDEX_KEYS, ignore_keys=["subCentre"]) assert "subCentre" not in index.index_keys def test_Dataset() -> None: