Skip to content

Commit b7dfb60

Browse files
fix(remap): throw an error if the input array is not contiguous
1 parent 6bf2847 commit b7dfb60

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fastremap/fastremap.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,9 @@ def remap(arr, table, preserve_missing_labels=False, in_place=False):
675675

676676
shape = arr.shape
677677

678+
if in_place and not (arr.flags.f_contiguous or arr.flags.c_contiguous):
679+
raise ValueError("Input array must be contiguous to use in_place.")
680+
678681
if arr.flags['F_CONTIGUOUS']:
679682
order = 'F'
680683
else:

0 commit comments

Comments
 (0)