diff --git a/numba_celltree/query.py b/numba_celltree/query.py index 7bdac08..e3e9f62 100644 --- a/numba_celltree/query.py +++ b/numba_celltree/query.py @@ -280,10 +280,10 @@ def locate_edge( return -1, indices_size indices[indices_size, 0] = index indices[indices_size, 1] = bbox_index - intersections[count, 0, 0] = c.x - intersections[count, 0, 1] = c.y - intersections[count, 1, 0] = d.x - intersections[count, 1, 1] = d.y + intersections[indices_size, 0, 0] = c.x + intersections[indices_size, 0, 1] = c.y + intersections[indices_size, 1, 0] = d.x + intersections[indices_size, 1, 1] = d.y indices_size += 1 count += 1 continue diff --git a/pixi.lock b/pixi.lock index 56ff3d1..843a02c 100644 --- a/pixi.lock +++ b/pixi.lock @@ -12153,7 +12153,7 @@ packages: timestamp: 1718888686982 - kind: pypi name: numba-celltree - version: 0.2.0 + version: 0.2.1 path: . sha256: 2bd3845e2ef418031ed6547ed4a50525b73be2ccae26e299dad0f6f6f824e02f requires_dist: diff --git a/tests/test_celltree.py b/tests/test_celltree.py index 51f1fb9..fc646cf 100644 --- a/tests/test_celltree.py +++ b/tests/test_celltree.py @@ -1,3 +1,7 @@ +import os + +os.environ["NUMBA_DISABLE_JIT"] = "1" +os.environ["NUMBA_NUM_THREADS"] = "1" import pathlib import shutil @@ -371,18 +375,12 @@ def test_edge_lookup(): expected_i = np.array([0, 1, 2]) expected_j = np.array([0, 1, 2]) expected_intersections = edge_coords[:3] - print(actual_i, expected_i) - print(actual_j, expected_j) - print(intersections, expected_intersections) assert np.array_equal(actual_i, expected_i) assert np.array_equal(actual_j, expected_j) assert np.allclose(intersections, expected_intersections) # Flip edge orientation actual_i, actual_j, intersections = tree.intersect_edges(edge_coords[:, ::-1]) - print(actual_i, expected_i) - print(actual_j, expected_j) - print(intersections, expected_intersections[:, ::-1]) assert np.array_equal(actual_i, expected_i) assert np.array_equal(actual_j, expected_j) assert np.allclose(intersections, expected_intersections[:, ::-1]) diff --git a/tests/test_utils.py b/tests/test_utils.py index 3863863..a5cb831 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -75,7 +75,7 @@ def test_double_stack(): stack, size = ut.push_both(stack, 1, 2, size) assert len(stack) == INITIAL_STACK_LENGTH * 2 assert size == INITIAL_STACK_LENGTH + 1 - assert np.array_equal(stack[32], (1, 2)) + assert np.array_equal(stack[INITIAL_STACK_LENGTH], (1, 2)) a, b, size = ut.pop_both(stack, size) assert size == INITIAL_STACK_LENGTH @@ -98,7 +98,7 @@ def test_triple_stack(): stack, size = ut.push_triple(stack, 1, 2, 3, size) assert len(stack) == INITIAL_STACK_LENGTH * 2 assert size == INITIAL_STACK_LENGTH + 1 - assert np.array_equal(stack[32], (1, 2, 3)) + assert np.array_equal(stack[INITIAL_STACK_LENGTH], (1, 2, 3)) a, b, c, size = ut.pop_triple(stack, size) assert size == INITIAL_STACK_LENGTH