From bb11938ecbec52f24da150c051470e8d6cf97fa8 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Tue, 14 May 2024 11:29:25 +0200 Subject: [PATCH] Relaxed type check of input array, to allow da.core.Array sub-classes (e. g. ResourceBackedDaskArray) (#361) Co-authored-by: Genevieve Buckley <30920819+GenevieveBuckley@users.noreply.github.com> --- dask_image/ndinterp/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dask_image/ndinterp/__init__.py b/dask_image/ndinterp/__init__.py index 1d422005..9a6d294d 100644 --- a/dask_image/ndinterp/__init__.py +++ b/dask_image/ndinterp/__init__.py @@ -83,7 +83,7 @@ def affine_transform( """ - if not type(image) == da.core.Array: + if not isinstance(image, da.core.Array): image = da.from_array(image) if output_shape is None: @@ -328,7 +328,7 @@ def rotate( (724, 724) """ - if not type(input_arr) == da.core.Array: + if not isinstance(input_arr, da.core.Array): input_arr = da.from_array(input_arr) if output_chunks is None: @@ -434,7 +434,7 @@ def spline_filter( **kwargs ): - if not type(image) == da.core.Array: + if not isinstance(image, da.core.Array): image = da.from_array(image) # use dispatching mechanism to determine backend @@ -492,7 +492,7 @@ def spline_filter1d( **kwargs ): - if not type(image) == da.core.Array: + if not isinstance(image, da.core.Array): image = da.from_array(image) # use dispatching mechanism to determine backend