Skip to content

Commit

Permalink
[gf] Fix deprecation warning in gf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Jan 14, 2022
1 parent 893c8de commit 9d7156d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/triqs/gf/gf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down

0 comments on commit 9d7156d

Please sign in to comment.