From e97e26593d0fdea9d1e03e23e045fefc54b16221 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 7 May 2023 15:52:44 +1200 Subject: [PATCH] Use "colour.utilities.as_float_array" in various optimisation factories. --- colour/characterisation/aces_it.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/colour/characterisation/aces_it.py b/colour/characterisation/aces_it.py index ae1aeb3cd..ec7917b34 100644 --- a/colour/characterisation/aces_it.py +++ b/colour/characterisation/aces_it.py @@ -822,7 +822,7 @@ def optimisation_factory_rawtoaces_v1() -> ( Examples -------- >>> optimisation_factory_rawtoaces_v1() # doctest: +SKIP - (array([1, 0, 0, 1, 0, 0]), \ + (array([ 1., 0., 0., 1., 0., 0.]), \ \ .objective_function at 0x...>, \ \ @@ -831,7 +831,7 @@ def optimisation_factory_rawtoaces_v1() -> ( .finaliser_function at 0x...>) """ - x_0 = np.array([1, 0, 0, 1, 0, 0]) + x_0 = as_float_array([1, 0, 0, 1, 0, 0]) def objective_function( M: NDArrayFloat, RGB: NDArrayFloat, Lab: NDArrayFloat @@ -892,7 +892,7 @@ def optimisation_factory_Jzazbz() -> ( Examples -------- >>> optimisation_factory_Jzazbz() # doctest: +SKIP - (array([1, 0, 0, 1, 0, 0]), \ + (array([ 1., 0., 0., 1., 0., 0.]), \ \ .objective_function at 0x...>, \ \ @@ -901,7 +901,7 @@ def optimisation_factory_Jzazbz() -> ( finaliser_function at 0x...>) """ - x_0 = np.array([1, 0, 0, 1, 0, 0]) + x_0 = as_float_array([1, 0, 0, 1, 0, 0]) def objective_function( M: ArrayLike, RGB: ArrayLike, Jab: ArrayLike @@ -966,7 +966,8 @@ def optimisation_factory_Oklab_15() -> ( Examples -------- >>> optimisation_factory_Oklab_15() # doctest: +SKIP - (array([1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1]), \ + (array([ 1., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., \ +0., 1.]), \ \ .objective_function at 0x...>, \ \ @@ -975,7 +976,7 @@ def optimisation_factory_Oklab_15() -> ( finaliser_function at 0x...>) """ - x_0 = np.array([1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1]) + x_0 = as_float_array([1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1]) def objective_function( M: ArrayLike, RGB: ArrayLike, Jab: ArrayLike