diff --git a/CHANGELOG.md b/CHANGELOG.md index 56a0ea89d..52c74c942 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Keep it human-readable, your future self will thank you! - Call filters from anemoi-transform - Make test optional when adls is not installed Pull request #110 - Add wz_to_w, orog_to_z, and sum filters (#149) +- Support list of indices for spatial masking (#162) ## [0.5.8](https://github.com/ecmwf/anemoi-datasets/compare/0.5.7...0.5.8) - 2024-10-26 diff --git a/src/anemoi/datasets/data/indexing.py b/src/anemoi/datasets/data/indexing.py index 41b4fb428..1a8624c75 100644 --- a/src/anemoi/datasets/data/indexing.py +++ b/src/anemoi/datasets/data/indexing.py @@ -18,7 +18,7 @@ def _tuple_with_slices(t, shape): result = tuple(slice(i, i + 1) if isinstance(i, int) else i for i in t) changes = tuple(j for (j, i) in enumerate(t) if isinstance(i, int)) - result = tuple(slice(*s.indices(shape[i])) for (i, s) in enumerate(result)) + result = tuple(s if isinstance(s, list) else slice(*s.indices(shape[i])) for (i, s) in enumerate(result)) return result, changes