diff --git a/pyclesperanto/_interroperability.py b/pyclesperanto/_interroperability.py index 570c1ab0..4f83c4d7 100644 --- a/pyclesperanto/_interroperability.py +++ b/pyclesperanto/_interroperability.py @@ -86,74 +86,74 @@ def set_wait_for_kernel_finish(wait: bool = True): wait_for_kernel_to_finish(wait) -def clip(a, a_min, a_max, out=None): - from ._tier2 import clip - - a = asarray(a) - if out: - out = asarray(out) - return clip( - input_image=a, - output_image=out, - min_intensity=a_min, - max_intensity=a_max, - device=a.device, - ) +# def clip(a, a_min, a_max, out=None): +# from ._tier2 import clip +# a = asarray(a) +# if out: +# out = asarray(out) +# return clip( +# input_image=a, +# output_image=out, +# min_intensity=a_min, +# max_intensity=a_max, +# device=a.device, +# ) -def mod(x1, x2, out=None): - from ._tier1 import modulo_images - x1 = asarray(x1) - if out: - out = asarray(out) - return modulo_images(input_image0=x1, input_image1=x2, device=x1.device) +# def mod(x1, x2, out=None): +# from ._tier1 import modulo_images +# x1 = asarray(x1) +# if out: +# out = asarray(out) +# return modulo_images(input_image0=x1, input_image1=x2, device=x1.device) -def sqrt(x, out=None): - from ._tier1 import square_root - x = asarray(x) - if out: - out = asarray(out) - return square_root(input_image=x, output_image=out, device=x.device) +# def sqrt(x, out=None): +# from ._tier1 import square_root +# x = asarray(x) +# if out: +# out = asarray(out) +# return square_root(input_image=x, output_image=out, device=x.device) -def cbrt(x, out=None): - from ._tier1 import cubic_root - x = asarray(x) - if out: - out = asarray(out) - return cubic_root(input_image=x, output_image=out, device=x.device) +# def cbrt(x, out=None): +# from ._tier1 import cubic_root +# x = asarray(x) +# if out: +# out = asarray(out) +# return cubic_root(input_image=x, output_image=out, device=x.device) -def power(x1, x2, out=None): - x1 = asarray(x1) - if out: - out = asarray(out) - # test if x2 is a scalar - if np.isscalar(x2): - from ._tier1 import power +# def power(x1, x2, out=None): +# x1 = asarray(x1) +# if out: +# out = asarray(out) - return power(input_image=x1, scalar=x2, output_image=out, device=x1.device) - else: - from ._tier1 import power_images +# # test if x2 is a scalar +# if np.isscalar(x2): +# from ._tier1 import power - x2 = asarray(x2) - return power_images( - input_image0=x1, input_image1=x2, output_image=out, device=x1.device - ) +# return power(input_image=x1, scalar=x2, output_image=out, device=x1.device) +# else: +# from ._tier1 import power_images + +# x2 = asarray(x2) +# return power_images( +# input_image0=x1, input_image1=x2, output_image=out, device=x1.device +# ) -def fabs(x, out=None): - from ._memory import create - from ._tier1 import absolute +# def fabs(x, out=None): +# from ._memory import create +# from ._tier1 import absolute - x = asarray(x) - if out: - out = asarray(out) - else: - out = create(x.shape, dtype=float, mtype=x.mtype, device=x.device) - return absolute(input_image=x, output_image=out, device=x.device) +# x = asarray(x) +# if out: +# out = asarray(out) +# else: +# out = create(x.shape, dtype=float, mtype=x.mtype, device=x.device) +# return absolute(input_image=x, output_image=out, device=x.device) diff --git a/tests/test_clip.py b/tests/test_clip.py index 6b05ee09..37f1c333 100644 --- a/tests/test_clip.py +++ b/tests/test_clip.py @@ -9,7 +9,7 @@ def test_clip_min_max(): test = [[0, 1], [2, 3]] reference = [[1, 1], [2, 2]] - result = cle.clip(test, a_min=1, a_max=2) + result = cle.clip(test, min_intensity=1, max_intensity=2) assert np.array_equal(result, reference) @@ -18,7 +18,7 @@ def test_clip_max(): test = [[0, 1], [2, 3]] reference = [[0, 1], [2, 2]] - result = cle.clip(test, a_min=0, a_max=2) + result = cle.clip(test, min_intensity=0, max_intensity=2) assert np.array_equal(result, reference) @@ -27,6 +27,6 @@ def test_clip_min(): test = [[0, 1], [2, 3]] reference = [[1, 1], [2, 3]] - result = cle.clip(test, a_min=1, a_max=3) + result = cle.clip(test, min_intensity=1, max_intensity=3) assert np.array_equal(result, reference) diff --git a/tests/test_operability.py b/tests/test_operability.py deleted file mode 100644 index c7e16c77..00000000 --- a/tests/test_operability.py +++ /dev/null @@ -1,59 +0,0 @@ -import numpy as np - -import pyclesperanto as cle - - -def test_mod(): - a = np.array([1, 2, 3, 4, 5]).astype(float) - b = np.array([2, 2, 2, 2, 2]).astype(float) - c = cle.mod(a, b) - - res = cle.pull(c) - - assert (res == np.array([1, 0, 1, 0, 1])).all() - - -def test_sqrt(): - a = np.array([1, 9, 25]).astype(float) - c = cle.sqrt(a) - - res = cle.pull(c) - - assert (res == np.array([1, 3, 5])).all() - - -def test_cbrt(): - a = np.array([1, 27, 125]).astype(float) - c = cle.cbrt(a) - - res = cle.pull(c) - - assert (res == np.array([1, 3, 5])).all() - - -def test_fabs(): - a = np.array([-1, -2, -3, -4, -5]).astype(float) - c = cle.fabs(a) - - res = cle.pull(c) - - assert (res == np.array([1, 2, 3, 4, 5])).all() - - -def test_power_scalar(): - a = np.array([1, 2, 3, 4, 5]).astype(float) - c = cle.power(a, 3) - - res = cle.pull(c) - - assert (res == np.array([1, 8, 27, 64, 125])).all() - - -def test_power_images(): - a = np.array([1, 2, 3, 4, 5]).astype(float) - b = np.array([3, 3, 3, 3, 3]).astype(float) - - c = cle.power(a, b) - res = cle.pull(c) - - assert (res == np.array([1, 8, 27, 64, 125])).all() diff --git a/tests/test_power.py b/tests/test_power.py index 04223f7c..3c14b8d8 100644 --- a/tests/test_power.py +++ b/tests/test_power.py @@ -30,7 +30,7 @@ def test_power(): ) ) - result = cle.power(test1, 3) + result = cle.power(test1, scalar=3) print(result)