Skip to content

Commit

Permalink
Replace np.float by float, since np.float is deprecated in numpy 1.20.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpre committed May 16, 2021
1 parent 5232149 commit e2309f0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions transforms3d/axangles.py
Expand Up @@ -144,7 +144,7 @@ def mat2axangle(mat, unit_thresh=1e-5):
-----
http://en.wikipedia.org/wiki/Rotation_matrix#Axis_of_a_rotation
"""
M = np.asarray(mat, dtype=np.float)
M = np.asarray(mat, dtype=float)
# direction: unit eigenvector of R33 corresponding to eigenvalue of 1
L, W = np.linalg.eig(M.T)
i = np.where(np.abs(L - 1.0) < unit_thresh)[0]
Expand Down Expand Up @@ -194,7 +194,7 @@ def aff2axangle(aff):
-----
http://en.wikipedia.org/wiki/Rotation_matrix#Axis_of_a_rotation
"""
R = np.asarray(aff, dtype=np.float)
R = np.asarray(aff, dtype=float)
direction, angle = mat2axangle(R[:3, :3])
# point: unit eigenvector of R33 corresponding to eigenvalue of 1
L, Q = np.linalg.eig(R)
Expand Down
10 changes: 5 additions & 5 deletions transforms3d/quaternions.py
Expand Up @@ -23,8 +23,8 @@
import math
import numpy as np

_MAX_FLOAT = np.maximum_sctype(np.float)
_FLOAT_EPS = np.finfo(np.float).eps
_MAX_FLOAT = np.maximum_sctype(float)
_FLOAT_EPS = np.finfo(float).eps


def fillpositive(xyz, w2_thresh=None):
Expand All @@ -38,7 +38,7 @@ def fillpositive(xyz, w2_thresh=None):
threshold to determine if w squared is really negative.
If None (default) then w2_thresh set equal to
``-np.finfo(xyz.dtype).eps``, if possible, otherwise
``-np.finfo(np.float).eps``
``-np.finfo(float).eps``
Returns
-------
Expand Down Expand Up @@ -304,9 +304,9 @@ def qinverse(q):
return qconjugate(q) / qnorm(q)


def qeye(dtype = np.float):
def qeye(dtype=float):
''' Return identity quaternion '''
return np.array([1.0,0,0,0], dtype = dtype)
return np.array([1.0,0,0,0], dtype=dtype)


def qexp(q):
Expand Down
2 changes: 1 addition & 1 deletion transforms3d/reflections.py
Expand Up @@ -43,7 +43,7 @@ def rfnorm2mat(normal):
where $I$ is the identity matrix.
"""
normal = np.asarray(normal, dtype=np.float)
normal = np.asarray(normal, dtype=float)
norm2 = (normal**2).sum()
M = np.eye(3)
return M - 2.0 * np.outer(normal, normal) / norm2
Expand Down
2 changes: 1 addition & 1 deletion transforms3d/tests/test_taitbryan.py
Expand Up @@ -12,7 +12,7 @@

from transforms3d.tests.samples import euler_tuples

FLOAT_EPS = np.finfo(np.float).eps
FLOAT_EPS = np.finfo(float).eps


def x_only(x):
Expand Down
4 changes: 2 additions & 2 deletions transforms3d/zooms.py
Expand Up @@ -133,7 +133,7 @@ def mat2zfdir(mat):
>>> np.allclose(S0, S1)
True
"""
mat = np.asarray(mat, dtype=np.float)
mat = np.asarray(mat, dtype=float)
factor = np.trace(mat) - 2.0
# direction: unit eigenvector corresponding to eigenvalue factor
l, V = np.linalg.eig(mat)
Expand Down Expand Up @@ -179,7 +179,7 @@ def aff2zfdir(aff):
True
>>> S0 = zfdir2aff(factor, direct, origin)
"""
M = np.asarray(aff, dtype=np.float)
M = np.asarray(aff, dtype=float)
factor, direction = mat2zfdir(M[:3,:3])
# origin: any eigenvector corresponding to eigenvalue 1
l, V = np.linalg.eig(M)
Expand Down

0 comments on commit e2309f0

Please sign in to comment.