Closed bjlittle closed 9 years ago
Commit 5c01bc0c7fc5a89f8ccb33baeb6244e2729132d5
>>> a = np.empty((2, 3, 4, 5)) >>> t = biggus.TransposedArray(a, (3, 1, 0, 2)) >>> t.shape (5, 3, 2, 4) >>> b = np.empty(t.shape) >>> b[:, ..., 0, ..., :].shape (5, 2, 4) >>> t[:, ..., 0, ..., :].shape Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/h05/itwl/projects/git/biggus/biggus/__init__.py", line 1013, in __getitem__ keys = _full_keys(keys, self.ndim) File "/home/h05/itwl/projects/git/biggus/biggus/__init__.py", line 2315, in _full_keys raise IndexError('Dimensions are over specified for indexing.') IndexError: Dimensions are over specified for indexing.
Looks like I missed the fact that the last Ellipsis can represent a null operation, not just slice(None) all of the time.
After #124:
>>> t[:, ..., 0, ..., :].shape (5, 2, 4)
Commit 5c01bc0c7fc5a89f8ccb33baeb6244e2729132d5