From dac8c3857542f3aefadf462b265af815676507f1 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sat, 10 Feb 2024 18:54:30 +1300 Subject: [PATCH] Use `np.reshape` function instead of `.reshape` method. --- colour_checker_detection/detection/common.py | 4 ++-- colour_checker_detection/detection/tests/test_common.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/colour_checker_detection/detection/common.py b/colour_checker_detection/detection/common.py index 8c0a319..3197f52 100644 --- a/colour_checker_detection/detection/common.py +++ b/colour_checker_detection/detection/common.py @@ -374,7 +374,7 @@ def reformat_image( Examples -------- - >>> image = np.arange(24).reshape([2, 4, 3]) + >>> image = np.reshape(np.arange(24), (2, 4, 3)) >>> image # doctest: +ELLIPSIS array([[[ 0, 1, 2], [ 3, 4, 5], @@ -480,7 +480,7 @@ def transform_image( Examples -------- - >>> image = np.arange(24).reshape([2, 4, 3]) + >>> image = np.reshape(np.arange(24), (2, 4, 3)) >>> image # doctest: +ELLIPSIS array([[[ 0, 1, 2], [ 3, 4, 5], diff --git a/colour_checker_detection/detection/tests/test_common.py b/colour_checker_detection/detection/tests/test_common.py index 7f108a3..4e238be 100644 --- a/colour_checker_detection/detection/tests/test_common.py +++ b/colour_checker_detection/detection/tests/test_common.py @@ -165,7 +165,7 @@ def test_transform_image(self): definition unit tests methods. """ - image = as_float32_array(np.arange(96)).reshape([4, 8, 3]) + image = np.reshape(as_float32_array(np.arange(96)), (4, 8, 3)) np.testing.assert_allclose( transform_image(image, np.array([2, 4]), 45, np.array([2, 3])),