From 9d7156d813b092e31aa2506eb26b2cd9f1660764 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Fri, 14 Jan 2022 09:23:33 -0500 Subject: [PATCH] [gf] Fix deprecation warning in gf.py --- python/triqs/gf/gf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/triqs/gf/gf.py b/python/triqs/gf/gf.py index 5f017139e4..9caceaa678 100644 --- a/python/triqs/gf/gf.py +++ b/python/triqs/gf/gf.py @@ -317,9 +317,9 @@ def __getitem__(self, key): assert self.rank > 1, "Internal error : impossible case" # here all == any for one argument mlist = self._mesh._mlist for x in key: - if isinstance(x, slice) and x != self._full_slice: raise NotImplementedError("Partial slice of the mesh not implemented") - # slice the data - k = [x.linear_index if isinstance(x, MeshPoint) else m.index_to_linear(x.idx) if isinstance(x, Idx) else x for x,m in zip(key,mlist)] + self._target_rank * [slice(0, None)] + if isinstance(x, slice) and x != self._full_slice: raise NotImplementedError("Partial slice of the mesh not implemented") + # slice the data + k = tuple(x.linear_index if isinstance(x, MeshPoint) else m.index_to_linear(x.idx) if isinstance(x, Idx) else x for x,m in zip(key,mlist)) + self._target_rank * (slice(0, None),) dat = self._data[k] # list of the remaining lists mlist = [m for i,m in filter(lambda tup_im : not isinstance(tup_im[0], (MeshPoint, Idx)), zip(key, mlist))]