Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
bf4aaf02
Commit
bf4aaf02
authored
Feb 01, 2020
by
Gabriele Buondonno
Browse files
[python] Undeprecate eye, zero and rand
parent
0cd333ff
Changes
1
Show whitespace changes
Inline
Side-by-side
bindings/python/pinocchio/utils.py
View file @
bf4aaf02
...
...
@@ -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
)
else
:
return
res
@
deprecated
(
"Please use numpy.zero"
)
def
zero
(
n
):
if
pin
.
getNumpyType
()
==
np
.
matrix
:
return
np
.
matrix
(
np
.
zeros
([
n
,
1
]
if
isinstance
(
n
,
int
)
else
n
))
else
:
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
]))
else
:
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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment