Skip to content

Commit

Permalink
remove clip
Browse files Browse the repository at this point in the history
  • Loading branch information
StRigaud committed Oct 18, 2024
1 parent 2f51de2 commit a6985b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions pyclesperanto/_interroperability.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@ 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):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

0 comments on commit a6985b5

Please sign in to comment.