Re: pyrolite - java error if remote object includes further libs in called method

"Handzsuj, Thomas" <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <B17AC98D7F7D3743B3885C200EDB60BA037E556305@CDECLUEXMBX02.corp.draeger.global>
Thanks a lot!

You've made my day :-)

As in most cases I should have come across this answer on my own.

I think pyrolite is a unique possibility to seamlessly connect all the python power in scientific calculations to the java world. I am using Python with Numpy, Scipy, Matplotlib etc. as replacement for Matlab - and I am very happy with that missing nothing. Connecting Matlab to Java is a pain.

Thanks again,
Thomas

-----Ursprüngliche Nachricht-----
Von: Irmen de Jong [mailto:[email protected]] 
Gesendet: Samstag, 15. Juni 2013 18:51
An: [email protected]
Betreff: Re: [Pyro] pyrolite - java error if remote object includes further libs in called method

On 14-6-2013 22:50, Irmen de Jong wrote:
> I don't have experience with numpy though. Is list(some-numpy-type) doing something odd?
> What are the elements of the resulting list?

I've reproduced the problem and it is caused by numpy:

>>> import numpy
>>> x=numpy.array([1.0, 2.0])
>>> y=list(x)
>>> y
[1.0, 2.0]
>>> type(y[0])
<type 'numpy.float64'>
>>>

So when you return list(x) from your Pyro object, it will still contain serialized numpy
types. Pyrolite doesn't support numpy types (yet).

A workaround is to convert the numpy array to a regular Python array.array, which Pyro
(and Pyrolite) support just fine. Or use self.x.tolist() to convert the numpy array to a
regular python list where the data items are also converted to normal python types.

In the first case you'll get a double[] in Java, in the second case ArrayList<Double>.

The java exception that you got is a bit cryptic but that is due to the way the pickle
protocol works internally...


Irmen


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Pyro-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyro-core
---
This communication contains confidential information. If you are not the intended recipient please return this email to the sender and delete it from your records.

Diese Nachricht enthaelt vertrauliche Informationen. Sollten Sie nicht der beabsichtigte Empfaenger dieser E-mail sein, senden Sie bitte diese an den Absender zurueck und loeschen Sie die E-mail aus Ihrem System.


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.