File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change 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
5741def test_zorder_query (sdata_with_points ):
You can’t perform that action at this time.
0 commit comments