Skip to content

Commit 1fe4655

Browse files
committed
Update
1 parent d24e23f commit 1fe4655

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

tests/test_sdata_points_zorder.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
sdata_morton_query_rect_debug,
1111
row_ranges_to_row_indices,
1212
orig_coord_to_norm_coord,
13-
MORTON_CODE_VALUE_MAX,
1413
)
1514

1615

17-
def is_sorted(arr):
16+
def _is_sorted(arr):
1817
return all(arr[i] <= arr[i + 1] for i in range(len(arr) - 1))
1918

2019

@@ -36,22 +35,7 @@ def test_zorder_sorting(sdata_with_points):
3635
sorted_ddf = sdata.points["transcripts"]
3736
morton_sorted = sorted_ddf["morton_code_2d"].compute().values.tolist()
3837

39-
assert is_sorted(morton_sorted)
40-
41-
42-
def norm_value_to_uint(value, v_min, v_max):
43-
"""
44-
Scale numeric value (int or float) to integer [0, 2^bits-1].
45-
"""
46-
# Cast to float64
47-
value_f64 = value.astype("float64")
48-
# Normalize the array values to be between 0.0 and 1.0
49-
norm_value_f64 = (value_f64 - v_min) / (v_max - v_min)
50-
# Clip to ensure no values are outside 0/1 range
51-
clipped_norm_value_f64 = np.clip(norm_value_f64, 0.0, 1.0)
52-
# Multiply by the morton code max-value to scale from [0,1] to [0,65535]
53-
out = (clipped_norm_value_f64 * MORTON_CODE_VALUE_MAX).astype(np.uint32)
54-
return out
38+
assert _is_sorted(morton_sorted)
5539

5640

5741
def test_zorder_query(sdata_with_points):

0 commit comments

Comments
 (0)