From 3bec81de32a9782947bd71cb7be4edfda8cecb50 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 12 Apr 2024 15:39:56 +0200 Subject: [PATCH] tests: fix rng.random use --- CHANGELOG.md | 2 ++ python/test/test.py | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9be545..5c14888 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- fix use of np.random in tests + ## [1.4.0] - 2024-04-12 - Add a SO3 curves which is C2. It's called S03Smooth diff --git a/python/test/test.py b/python/test/test.py index 8ff361f..40e2112 100644 --- a/python/test/test.py +++ b/python/test/test.py @@ -546,10 +546,10 @@ def test_piecewise_polynomial_curve(self): def test_piecewise_from_points_list(self): N = 7 rng = random.default_rng() - points = array(rng.random(3, N)) - points_derivative = array(rng.random(3, N)) - points_second_derivative = array(rng.random(3, N)) - time_points = array(rng.random(1, N)).T + points = array(rng.random((3, N))) + points_derivative = array(rng.random((3, N))) + points_second_derivative = array(rng.random((3, N))) + time_points = array(rng.random((1, N))).T time_points.sort(0) polC0 = piecewise.FromPointsList(points, time_points) self.assertEqual(polC0.min(), time_points[0, 0]) @@ -1286,10 +1286,10 @@ def test_se3_from_translation_curve(self): # test with piecewise polynomial N = 7 rng = random.default_rng() - points = array(rng.random(3, N)) + points = array(rng.random((3, N))) # points_derivative = array(random.rand(3, N)) # points_second_derivative = array(random.rand(3, N)) - time_points = array(rng.random(1, N)).T + time_points = array(rng.random((1, N))).T time_points.sort(0) translation = piecewise3.FromPointsList(points, time_points) min = translation.min()