Skip to content

Commit

Permalink
Fixes for Numpy 2.0, latest pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-brett committed Jun 17, 2024
1 parent d6bb759 commit 914fee8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion transforms3d/axangles.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def axangle2aff(axis, angle, point=None):
M[:3,:3] = R
if point is not None:
# rotation not around origin
point = np.array(point[:3], dtype=np.float64, copy=False)
point = np.array(point[:3], dtype=np.float64)
M[:3, 3] = point - np.dot(R, point)
return M

Expand Down
4 changes: 2 additions & 2 deletions transforms3d/conftest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
""" Configuration for py.test test run
"""

def pytest_ignore_collect(path, config):
def pytest_ignore_collect(collection_path, config):
""" Skip the origin Gohlke transforms for doctests.
That file needs some specific doctest setup.
"""
return path.basename == '_gohlketransforms.py'
return collection_path.name == '_gohlketransforms.py'
3 changes: 1 addition & 2 deletions transforms3d/quaternions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import math
import numpy as np

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


Expand Down Expand Up @@ -86,7 +85,7 @@ def fillpositive(xyz, w2_thresh=None):
except (AttributeError, ValueError):
w2_thresh = -_FLOAT_EPS * 3
# Use maximum precision
xyz = np.asarray(xyz, dtype=_MAX_FLOAT)
xyz = np.asarray(xyz, dtype=np.float64)
# Calculate w
w2 = 1.0 - np.dot(xyz, xyz)
if w2 < 0:
Expand Down

0 comments on commit 914fee8

Please sign in to comment.