Changes between Version 5 and Version 6 of ZeroRankArray

Show
Ignore:
Timestamp:
01/10/06 22:07:35 (7 years ago)
Author:
sasha
Comment:

Described new features in svn

Legend:

Unmodified
Added
Removed
Modified
  • ZeroRankArray

    v5 v6  
    6868See changeset:1864 for implementation of x[...] and x[()] returning numpy scalars. 
    6969 
     70See changeset:1866 for implementation of x[...] = v and x[()] = v.  
    7071 
    7172=== Increasing rank with newaxis === 
    7273 
    73 more to come 
     74Everyone who commented liked this feature, so as of changeset:1871 any number of ellipses and newaxis tokens can 
     75be placed as a subscript argument for a zero-rank array. For example: 
     76{{{ 
     77>>> x = array(1) 
     78>>> x[newaxis,...,newaxis,...] 
     79array([[1]]) 
     80}}} 
     81It is not clear why more than one ellipsis should be allowed, but this is the behavior of higher rank arrays that we 
     82are trying to preserve. 
     83 
     84=== Refactoring === 
     85Currently all indexing on zero-rank arrays is implemented in a special if (nd == 0) branch of code that used to always 
     86raise an index error. This ensures that the changes do not affect any existing usage (except, the usage that relies on exceptions). 
     87On the other hand part of motivation for these changes was to make behavior of ndarrays more uniform and this should allow to 
     88eliminate  if (nd == 0) checks alltogether. 
     89