Skip to content

Commit 9ba813d

Browse files
committed
Ensure that colour.utilities.tsplit definition returns a contiguous copy of the input array.
References #1309.
1 parent b669eed commit 9ba813d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

colour/utilities/array.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -2232,13 +2232,7 @@ def tsplit(
22322232

22332233
a = as_array(a, dtype)
22342234

2235-
if a.ndim <= 2:
2236-
return np.transpose(a)
2237-
2238-
return np.transpose(
2239-
a,
2240-
np.concatenate([[a.ndim - 1], np.arange(0, a.ndim - 1)]),
2241-
)
2235+
return np.array([a[..., x] for x in range(a.shape[-1])])
22422236

22432237

22442238
def row_as_diagonal(a: ArrayLike) -> NDArray:

0 commit comments

Comments
 (0)