From 0ca6475d38af434d1c3dfa56b47b115b8e9c8275 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Wed, 25 Dec 2024 08:15:21 +1300 Subject: [PATCH] Revert "Update `colour.utilities.centroid` return typing annotation." This reverts commit f930a939126531de7ad1182b5be5b29d104e2234. --- colour/utilities/array.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/colour/utilities/array.py b/colour/utilities/array.py index 41e370f11..76fbb585c 100644 --- a/colour/utilities/array.py +++ b/colour/utilities/array.py @@ -2401,7 +2401,9 @@ def centroid(a: ArrayLike) -> NDArrayInt: a_ci.append(np.sum(axis * a) // a_s) - return as_int_array(a_ci) + # NOTE: Cannot use `as_int_array` as presence of NaN will raise a ValueError + # exception. + return np.array(a_ci).astype(DTYPE_INT_DEFAULT) def fill_nan(