Skip to content

Commit

Permalink
clean up and test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
StRigaud committed Dec 1, 2023
1 parent fa2eaeb commit f5d4678
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
11 changes: 1 addition & 10 deletions pyclesperanto/_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,9 @@ def __getitem__(self, key):


def __setitem__(self, key, value):
if not isinstance(value, Union[Array, np.ndarray]):
if not isinstance(value, (Array, np.ndarray)):
value = np.array(value)
key = _clean_index(key)
print(f"value type: {type(value)}")
print(f"value dtype: {value.dtype}")
# check if the dtype of the value is a numeric type such as float, int etc
if value.dtype not in _supported_numeric_types:
raise ValueError(
Expand All @@ -402,8 +400,6 @@ def __setitem__(self, key, value):
index[x] = [key[x], key[x] + 1 if key[x] > 0 else key[x] - 1, None]
key = index

print(f"key: {key}")

# manage range for (x,y,z), with nothing that we deal with a z,y,x order
use_range, range_x, range_y, range_z = _compute_range(key, self.shape)
origin = [range_z[0], range_y[0], range_x[0]]
Expand All @@ -414,11 +410,6 @@ def __setitem__(self, key, value):
]
region = [abs(x) for x in region]

print(f"origin: {origin}, region: {region}")
print(
f"use_range: {use_range}, range_x: {range_x}, range_y: {range_y}, range_z: {range_z}"
)

stride_region = [
abs(region[0] / range_z[2]),
abs(region[1] / range_y[2]),
Expand Down
3 changes: 0 additions & 3 deletions pyclesperanto/_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
def _correct_range(start, stop, step, size):
print(start, stop, step)
# set in case not set (passed None)
if step is None:
step = 1
Expand Down Expand Up @@ -37,8 +36,6 @@ def _correct_range(start, stop, step, size):
# swap start and stop
start, stop = stop, start

print(start, stop, step)

return start, stop, step


Expand Down

0 comments on commit f5d4678

Please sign in to comment.