• Kirill Smelkov's avatar
    bigarray: Be explicit about not-supporting advanced indexing · 4680c0cd
    Kirill Smelkov authored
    In NumPy speak advanced indexing is picking up arbitrarily requested
    elemtnts, e.g.
    
        a = arange(10)
        a[[0,3,2]]  -> array([0, 3, 2])
    
    The way this indexing schem works is - it creates a new array with
    len = len(key), and picks up requested elements sequentially into new
    area.
    
    So it is very not the same as creating _view_ to original array data by
    using basic indexing [1]
    
    BigArray does not support advanced indexing, because its main job is to
    organize an ndarray _view_ backed up by BigFile data and give that view
    to clients, and then it is up to clients how to use that view with full
    numpy api available with it.
    
    So be explicit, and reject advanced indexing in __getitem__ right at the
    beginning.
    
    [1] http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html
    4680c0cd
test_basic.py 9.89 KB