Hello ,
In order to use numpy inside grasshopper, I planned to use the Proxy of Compass Package.
Unfortunately, during my test, done outside of grasshopper using Pycharm, to compare the efficiency of my own, pure python, method and numpy’s ones via Proxy, I encountered some freezes …
The code I ran with python 2.7 is the following:
# -*- coding: utf-8 -*-
import numpy as np
import time
from compas.rpc import Proxy
linalg = Proxy('numpy.linalg', url='http://127.0.0.1')
a = np.random.rand(20, 20) * 100.
v = np.random.rand(20)
n_iter = 62
print("via numpy")
t_0 = time.time()
for i in range(n_iter):
print(i)
c = linalg.solve(a,v)
c = 0.
print("via numpy\nNombre d'itérations: {}\nTemps: {}".format(n_iter, time.time() - t_0))
The process always freezes at the 61th iterations … If I lower n_iter everything runs smoothly …
I was wondering if anyone has an idea of why it happens and if there’s any way to solve the problem ?
Thank you very much,
Alexandre