[NumPy-Tickets] [NumPy] #2011: nested_iters does not accept length zero nest (and no documentation)

NumPy Trac numpy-tickets@scipy....
Thu Jan 5 11:18:57 CST 2012


#2011: nested_iters does not accept length zero nest (and no documentation)
------------------------+---------------------------------------------------
 Reporter:  jsalvatier  |       Owner:  somebody   
     Type:  defect      |      Status:  new        
 Priority:  normal      |   Milestone:  Unscheduled
Component:  numpy.core  |     Version:  1.6.1      
 Keywords:              |  
------------------------+---------------------------------------------------
 While using the nested_iters function, I've noticed that it does not
 accept length zero nestings. For example, the following fails:

 nested_iters([ones(3),ones(3)], [[], [0]])

 with "ValueError: If 'op_axes' or 'itershape' is not NULL in theiterator
 constructor, 'oa_ndim' must be greater than zero"

 This makes a certain amount of sense to me, but I think having the
 iterator with the empty axes have a single iteration would be more useful.
 For example, if you are using nested_iters to ally a function along a
 specific set of axes, you'll otherwise have to special case the case where
 those axes take up the whole array (which is my use case). This is not
 much of a hassle for me, but I thought other people might like to know.

 Also, I could not find any nested_iters documentation.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2011>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list