[IPython-User] Passing numpy masked arrays with apply
Jesper Baasch-Larsen
jesper.webmail@gmail....
Fri Feb 1 03:27:26 CST 2013
Hi MinRK
Thanks for the info.
Best regards
Jesper
Den 31/01/2013 kl. 23.31 skrev MinRK <benjaminrk@gmail.com>:
>
>
> On Thu, Jan 31, 2013 at 1:35 PM, Jesper Larsen <jesper.webmail@gmail.com> wrote:
>> Hi IPython users,
>>
>> I am trying out the IPython parallel facilities. I need to pass a numpy masked array into a function using the apply_async view method. It seems however like it is converted to an ordinary numpy.ndarray when I do that:
>>
>> import numpy as np
>> from IPython.parallel import Client
>>
>> def foo(a):
>> return a
>>
>> rc = Client()
>> dview = rc[:]
>>
>> for i in range(3):
>> result = dview.apply_async(foo, np.ma.zeros((1)))
>> print type(result.get()[0])
>>
>> The type of the last print statement is numpy.ndarray. It should be a masked array.
>>
>> Am I doing something wrong or is this a bug?
>
> There was an isinstance check that inappropriately caught ndarray subclasses. I believe this is fixed in master, if you want to check.
>
>>
>> Best regards,
>> Jesper
>>
>> _______________________________________________
>> IPython-User mailing list
>> IPython-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-user
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20130201/e93aaa22/attachment.html
More information about the IPython-User
mailing list