On Fri, Jul 29, 2011 at 4:12 AM, Hans Meine <me...@informatik.uni-hamburg.de > wrote:
> Am Freitag, 29. Juli 2011, 11:31:24 schrieb Hans Meine: > > Am Donnerstag, 28. Juli 2011, 17:42:38 schrieb Matthew Brett: > > > Was there a particular case you ran into where this was a problem? > > [...] > > Basically, the problem arose because our ndarray subclass does not > support > > zero-rank-instances fully. (And previously, there was no need for that.) > > I just reproduced the problem, it was this exception: > > /home/hmeine/new_numpy/lib64/python2.6/site-packages/vigra/arraytypes.pyc > in > reshape(self, shape, order) > 587 > 588 def reshape(self, shape, order='C'): > --> 589 res = numpy.ndarray.reshape(self, shape, order) > 590 res.axistags = AxisTags(res.ndim) > 591 return res > > TypeError: an integer is required > > The problem is that 'self' has become a zero-rank array, and those cannot > be > reshaped in order to add singleton dimensions anymore. IOW, if you > implement > sth. like broadcasting, this is made much harder. > > What is self and shape in this example? Out of curiosity, if you don't support all the ndarray operations, why are you subclassing ndarray? Chuck
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion