[NumPy-Tickets] [NumPy] #1559: atleast_?d() breaks masked arrays

NumPy Trac numpy-tickets@scipy....
Mon Aug 9 20:03:46 CDT 2010


#1559: atleast_?d() breaks masked arrays
------------------------+---------------------------------------------------
 Reporter:  weathergod  |       Owner:  somebody    
     Type:  defect      |      Status:  needs_review
 Priority:  high        |   Milestone:  1.5.0       
Component:  numpy.ma    |     Version:              
 Keywords:              |  
------------------------+---------------------------------------------------

Comment(by pierregm):

 Mmh, this illustrates an actual obscure bug.
 See, in __array_finalize__(self, obj), we set self._mask to obj._mask (if
 any), and then set self._mask.shape to self.shape. The second step is
 required to make sure that setting the shape in place (like in
 self.shape=newshape) updates the shape of the mask.
 Except that in the np.atleast_nd case, this step also updates obj._mask,
 which we don't want...
 In fact, we should take a view of obj._mask and update this one, but that
 breaks setting the shape in place...

 So, the solution being proposed is rather a monkeypatch than a real fix.
 Let me try to figure this one out, at worst we'll use that patch as a
 back-up plan.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1559#comment:4>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list