[Numpy-discussion] Numpy 1.4 MaskedArray bug?

Charles سمير Doutriaux doutriaux1@llnl....
Tue Jan 19 12:32:33 CST 2010


Hi Pierre,

We didn't move to 1.4 yet.

Should we wait for 1.4.1? It seems there's some issues with numpy.ma  
in 1.4 and we rely heavily on it.

C.

On Jan 12, 2010, at 11:50 AM, Pierre GM wrote:

> On Jan 12, 2010, at 1:52 PM, Charles R Harris wrote:
>>
>>
>>
>> On Tue, Jan 12, 2010 at 11:32 AM, Pauli Virtanen <pav@iki.fi> wrote:
>> ti, 2010-01-12 kello 12:51 -0500, Pierre GM kirjoitti:
>> [clip]
>>>>>>> a = numpy.ma.MaskedArray([[1,2,3],[4,5,6]])
>>>>>>> numpy.ma.sum(a, 1)
>>>> Traceback (most recent call last):
>>>> File "<stdin>", line 1, in <module>
>>>> File
>>>> "/usr/lib64/python2.5/site-packages/numpy-1.4.0-py2.5-linux- 
>>>> x86_64.egg/n
>>>> umpy/ma/core.py", line 5682, in __call__
>>>>   return method(*args, **params)
>>>> File
>>>> "/usr/lib64/python2.5/site-packages/numpy-1.4.0-py2.5-linux- 
>>>> x86_64.egg/n
>>>> umpy/ma/core.py", line 4357, in sum
>>>>   newmask = _mask.all(axis=axis)
>>>> ValueError: axis(=1) out of bounds
>>>
>>> Confirmed.
>>> Before I take full blame for it, can you try the following on both  
>>> 1.3 and 1.4 ?
>>>>>> np.array(False).all().sum(1)
>>
>> Oh crap, it's mostly my fault:
>>
>> http://*projects.scipy.org/numpy/ticket/1286
>> http://*projects.scipy.org/numpy/changeset/7697
>> http://*projects.scipy.org/numpy/browser/trunk/doc/release/1.4.0- 
>> notes.rst#deprecations
>>
>> Pretty embarassing, as very simple things break, although the test  
>> suite
>> miraculously passes...
>>
>>> Back to your problem: I'll fix that ASAIC, but it'll be on the  
>>> SVN. Meanwhile, you can:
>>> * Use -1 instead of 1 for your axis.
>>> * Force the definition of a mask when you define your array with  
>>> masked_array(...,mask=False)
>>
>> Sounds like we need a 1.4.1 out at some point not too far in the  
>> future,
>> then.
>>
>>
>> If so, then it should be sooner rather than later in order to sync  
>> with the releases of ubuntu and fedora. Both of the upcoming  
>> releases still use 1.3.0, but that could change...
>
> I guess that the easiest would be for me to provide a workaround for  
> the bug (Pauli's modifications make sense, I was relying on a  
> *feature* that wasn't very robust).
> I'll update both the trunk and the 1.4.x branch
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://*mail.scipy.org/mailman/listinfo/numpy-discussion
>



More information about the NumPy-Discussion mailing list