python3Packages.pyquaternion: fix build (#517058)

This commit is contained in:
Peder Bergebakken Sundt
2026-05-10 21:14:30 +00:00
committed by GitHub
2 changed files with 16 additions and 0 deletions
@@ -21,6 +21,9 @@ buildPythonPackage rec {
patches = [
./numpy2-repr.patch
# patch tests for numpy v2.4 behaviour
# https://numpy.org/devdocs/release/2.4.0-notes.html#raise-typeerror-on-attempt-to-convert-array-with-ndim-0-to-scalar
./numpy2-float.patch
];
# The VERSION.txt file is required for setup.py
@@ -0,0 +1,13 @@
diff --git a/pyquaternion/test/test_quaternion.py b/pyquaternion/test/test_quaternion.py
index f56afff..1a121c4 100644
--- a/pyquaternion/test/test_quaternion.py
+++ b/pyquaternion/test/test_quaternion.py
@@ -936,7 +936,7 @@ class TestQuaternionFeatures(unittest.TestCase):
for i in range(20):
v = np.random.uniform(-1, 1, 3)
v /= np.linalg.norm(v)
- theta = float(np.random.uniform(-2,2, 1)) * pi
+ theta = np.random.uniform(-2,2, 1).item() * pi
self.validate_axis_angle(v, theta)
def test_exp(self):