Skip to content

Commit

Permalink
Fix indices on fieldlist filtered with sel
Browse files Browse the repository at this point in the history
  • Loading branch information
sandorkertesz committed Nov 29, 2023
1 parent a075a7f commit 3b117b4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/grib/test_grib_inidces.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,26 @@ def test_grib_indices_multi_Del(mode):
ds1 = ds.sel(param="t", level=[93, 500])
r = ds1.indices()
assert r == ref


@pytest.mark.parametrize("mode", ["file", "numpy_fs"])
def test_grib_indices_order_by(mode):
ds = load_file_or_numpy_fs("tuv_pl.grib", mode)

ref = {
"class": ["od"],
"stream": ["oper"],
"levtype": ["pl"],
"type": ["an"],
"expver": ["0001"],
"date": [20180801],
"time": [1200],
"domain": ["g"],
"number": [0],
"levelist": [300, 400, 500, 700, 850, 1000],
"param": ["t", "u", "v"],
}

ds1 = ds.order_by(levelist="descending")
r = ds1.indices()
assert r == ref

0 comments on commit 3b117b4

Please sign in to comment.