Vectorized operations with Numpy

Hi,

I would like to know if it is possible to do some simple vectorized operations with Numpy using “Remote Procedure Calls”.

I understand that arrays are automatically converted to lists but wouldn’t that make any array manipulation impossible then ?

from compas.rpc import Proxy

np = Proxy('numpy')

np.ones(10).reshape(5, 2) # --> "list object has no attribute reshape"

np.arange(10) * np.random.uniform(4)  # --> ""can't multiply sequence by non-int of type float"
1 Like

hi,

that is indeed not possible with compas.rpc.
the objectives of our RPCs is not necessarily to make all functionality of CPython packages like Numpy available in IronPython, but rather to make sure that you can run algorithms based on such packages directly from Rhino/GH.

is there a particular application of the above you have in mind? or just playing around to see what is possible?

1 Like

(My apologies for the late reply)

Thank you for your reply. Had nothing specific in mind, I was just trying to figure out if rpc could allow to do some vectorized operations within a non-CPython based environement. That would have been neat !