bastibe / transplant

Transplant is an easy way of calling Matlab from Python
https://transplant.readthedocs.io
Other
110 stars 26 forks source link

Keyword argument to force return values to proxy #48

Open bastibe opened 7 years ago

bastibe commented 7 years ago

As per #46:

calling a chain of functions on large matrices or other objects makes transferring large amount of data multiple times between python and matlab, e.g.

A = mlab.myfun()
B = mlab.myfun2(A)
C = mlab.myfun3(B)

If A, B and C are large matrices the above command might be limited by the data transfer. It would be nice to specify per function call to keep the result in the proxy in matlab and send only a pointer to python as you are already doing it for objects. For example:

A = mlab.myfun(inproxy=True)
B = mlab.myfun2(A,inproxy=True)
C = mlab.myfun3(B,inproxy=True)
bastibe commented 7 years ago

@tsdev I currently don't have much time to work on this, but it seems a very good idea, and I'll get to it in due time!