mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-10 12:39:13 +08:00
Fix order kwarg for some versions of numpy.copy
It seems it isn't always a valid kwarg. This bypasses that problem by calling `np.array` directly (which is just what `np.copy` does under the hood anyway).
This commit is contained in:
@@ -1532,7 +1532,7 @@ def crop(ar, crop_width, copy=False, order='K'):
|
||||
crops = _validate_lengths(ar, crop_width)
|
||||
slices = [slice(a, ar.shape[i] - b) for i, (a, b) in enumerate(crops)]
|
||||
if copy:
|
||||
cropped = np.copy(ar[slices], order=order)
|
||||
cropped = np.array(ar[slices], order=order, copy=True)
|
||||
else:
|
||||
cropped = ar[slices]
|
||||
return cropped
|
||||
|
||||
Reference in New Issue
Block a user