[IPython-User] Passing numpy masked arrays with apply

MinRK benjaminrk@gmail....
Thu Jan 31 16:31:16 CST 2013


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20130131/819992b5/attachment.html 


More information about the IPython-User mailing list