diff --git a/src/anemoi/utils/data_structures.py b/src/anemoi/utils/data_structures.py index d1bba5b..f4f21d8 100644 --- a/src/anemoi/utils/data_structures.py +++ b/src/anemoi/utils/data_structures.py @@ -229,6 +229,9 @@ def __init__(self, arrays, **kwargs): arrays = {i: v for i, v in enumerate(arrays)} self.arrays = arrays + def keys(self): + return self.arrays.keys() + def clone(self): raise NotImplementedError @@ -239,8 +242,8 @@ def check_array_type(self, arrays): assert isinstance(a, _type), (type(a), _type) def __getitem__(self, tupl): - assert isinstance(tupl, (int, tuple)), type(tupl) - if isinstance(tupl, int): + assert isinstance(tupl, (int, tuple, str)), type(tupl) + if isinstance(tupl, int) or isinstance(tupl, str): return self.arrays[tupl] assert len(tupl) == 2 i, j = tupl