SciTools / biggus

:no_entry: [DEPRECATED] Virtual large arrays and lazy evaluation.
http://biggus.readthedocs.io/
GNU Lesser General Public License v3.0
54 stars 27 forks source link

Support leading ellipsis indexing #64

Closed pelson closed 9 years ago

pelson commented 10 years ago
NumpyArrayAdapter(np.arange(24).reshape(3, 4, 2))[..., 0]

Currently:

Traceback (most recent call last):
  File "biggus/biggus/__init__.py", line 1463, in <module>
    b = NumpyArrayAdapter(np.arange(24).reshape(3, 4, 2))[..., 0]
  File "biggus/biggus/__init__.py", line 503, in __getitem__
    result_key = self._cleanup_new_key(new_key, size, axis)
  File "biggus/biggus/__init__.py", line 423, in _cleanup_new_key
    raise TypeError('invalid key {!r}'.format(key))
TypeError: invalid key Ellipsis
pelson commented 9 years ago

After #127.

>>> NumpyArrayAdapter(np.arange(24).reshape(3, 4, 2))[..., 0]
<NumpyArrayAdapter shape=(3, 4) dtype=dtype('int64')>