Commit bf4aaf02 authored by Gabriele Buondonno's avatar Gabriele Buondonno
Browse files

[python] Undeprecate eye, zero and rand

parent 0cd333ff
......@@ -14,17 +14,24 @@ from .rpy import matrixToRpy, npToTTuple, npToTuple, rotate, rpyToMatrix
from .deprecation import deprecated
@deprecated("Please use numpy.eye")
def eye(n):
return np.matrix(np.eye(n))
res = np.eye(n)
if pin.getNumpyType()==np.matrix:
return np.matrix(res)
return res
@deprecated("Please use")
def zero(n):
if pin.getNumpyType()==np.matrix:
return np.matrix(np.zeros([n, 1] if isinstance(n, int) else n))
return np.zeros(n)
@deprecated("Please use numpy.random.rand")
def rand(n):
if pin.getNumpyType()==np.matrix:
return np.matrix(np.random.rand(n, 1) if isinstance(n, int) else np.random.rand(n[0], n[1]))
return np.random.rand(n) if isinstance(n, int) else np.random.rand(n[0], n[1])
@deprecated("Please use numpy.cross(a, b) or numpy.cross(a, b, axis=0).")
def cross(a, b):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment