fastquadtree 1.1.0__tar.gz → 1.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fastquadtree might be problematic. Click here for more details.
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/Cargo.lock +1 -1
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/Cargo.toml +1 -1
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/PKG-INFO +1 -1
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/pysrc/fastquadtree/pyqtree.py +9 -1
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_pyqtree_shim_compat.py +58 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/.github/workflows/docs.yml +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/.github/workflows/release.yml +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/.gitignore +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/.pre-commit-config.yaml +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/LICENSE +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/README.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/assets/ballpit.png +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/assets/interactive_v2_rect_screenshot.png +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/assets/interactive_v2_screenshot.png +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/assets/quadtree_bench_throughput.png +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/assets/quadtree_bench_time.png +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/benchmark_native_vs_shim.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/benchmark_np_vs_list.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/cross_library_bench.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/quadtree_bench/__init__.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/quadtree_bench/engines.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/quadtree_bench/main.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/quadtree_bench/plotting.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/quadtree_bench/runner.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/requirements.txt +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/runner.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/benchmarks/system_info_collector.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/api/point_item.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/api/pyqtree.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/api/quadtree.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/api/rect_item.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/api/rect_quadtree.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/benchmark.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/future_features.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/index.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/quickstart.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/runnables.md +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/docs/styles/overrides.css +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/interactive/ballpit.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/interactive/interactive.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/interactive/interactive_v2.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/interactive/interactive_v2_rect.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/interactive/requirements.txt +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/mkdocs.yml +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/pyproject.toml +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/pysrc/fastquadtree/__init__.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/pysrc/fastquadtree/_base_quadtree.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/pysrc/fastquadtree/_item.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/pysrc/fastquadtree/_obj_store.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/pysrc/fastquadtree/point_quadtree.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/pysrc/fastquadtree/py.typed +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/pysrc/fastquadtree/rect_quadtree.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/src/geom.rs +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/src/lib.rs +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/src/quadtree.rs +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/src/rect_quadtree.rs +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/insertions.rs +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/nearest_neighbor.rs +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/query.rs +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/rect_quadtree.rs +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/rectangle_traversal.rs +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_base_quadtree.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_clear.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_delete.rs +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_delete_by_object.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_delete_python.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_insert_many_numpy.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_obj_store.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_point_quadtree_nn_runtime.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_python.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_rect_quadtree.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_unconventional_bounds.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/test_wrapper_edges.py +0 -0
- {fastquadtree-1.1.0 → fastquadtree-1.1.2}/tests/unconventional_bounds.rs +0 -0
|
@@ -40,7 +40,7 @@ class Index:
|
|
|
40
40
|
Based on the benchmarks, this gives a overall performance boost of 6.514x.
|
|
41
41
|
See the benchmark section of the docs for more details and the latest numbers.
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Original docstring from pyqtree follows:
|
|
44
44
|
The top spatial index to be created by the user. Once created it can be
|
|
45
45
|
populated with geographically placed members that can later be tested for
|
|
46
46
|
intersection with a user inputted geographic bounding box. Note that the
|
|
@@ -122,6 +122,9 @@ class Index:
|
|
|
122
122
|
- **item**: The item to insert into the index, which will be returned by the intersection method
|
|
123
123
|
- **bbox**: The spatial bounding box tuple of the item, with four members (xmin,ymin,xmax,ymax)
|
|
124
124
|
"""
|
|
125
|
+
if type(bbox) is list: # Handle list input
|
|
126
|
+
bbox = tuple(bbox)
|
|
127
|
+
|
|
125
128
|
if self._free:
|
|
126
129
|
rid = self._free.pop()
|
|
127
130
|
self._objects[rid] = item
|
|
@@ -141,6 +144,9 @@ class Index:
|
|
|
141
144
|
|
|
142
145
|
Both parameters need to exactly match the parameters provided to the insert method.
|
|
143
146
|
"""
|
|
147
|
+
if type(bbox) is list: # Handle list input
|
|
148
|
+
bbox = tuple(bbox)
|
|
149
|
+
|
|
144
150
|
rid = self._item_to_id.pop(id(item))
|
|
145
151
|
self._qt.delete(rid, bbox)
|
|
146
152
|
self._objects[rid] = None
|
|
@@ -157,6 +163,8 @@ class Index:
|
|
|
157
163
|
Returns:
|
|
158
164
|
- A list of inserted items whose bounding boxes intersect with the input bbox.
|
|
159
165
|
"""
|
|
166
|
+
if type(bbox) is list: # Handle list input
|
|
167
|
+
bbox = tuple(bbox)
|
|
160
168
|
result = self._qt.query_ids(bbox)
|
|
161
169
|
# result = [id1, id2, ...]
|
|
162
170
|
return gather_objs(self._objects, result)
|
|
@@ -343,3 +343,61 @@ def test_dense_targets_along_partition_lines_match_pyqtree():
|
|
|
343
343
|
]
|
|
344
344
|
for q in thin_queries:
|
|
345
345
|
results_match_exact(fqt, pyq, q)
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def test_query_list_and_tuple_equivalence():
|
|
349
|
+
"""Test that both list and tuple inputs for bbox work the same."""
|
|
350
|
+
idx = FQTIndex(bbox=WORLD)
|
|
351
|
+
|
|
352
|
+
obj1, box1 = "obj1", (10.0, 10.0, 20.0, 20.0)
|
|
353
|
+
obj2, box2 = "obj2", (30.0, 30.0, 40.0, 40.0)
|
|
354
|
+
|
|
355
|
+
idx.insert(obj1, box1)
|
|
356
|
+
idx.insert(obj2, box2)
|
|
357
|
+
|
|
358
|
+
query_tuple = (15.0, 15.0, 25.0, 25.0)
|
|
359
|
+
query_list = [15.0, 15.0, 25.0, 25.0]
|
|
360
|
+
|
|
361
|
+
results_from_tuple = idx.intersect(query_tuple)
|
|
362
|
+
results_from_list = idx.intersect(query_list)
|
|
363
|
+
|
|
364
|
+
assert results_from_tuple == results_from_list == [obj1]
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
def test_remove_list_and_tuple_equivalence():
|
|
368
|
+
"""Test that both list and tuple inputs for bbox work the same in remove."""
|
|
369
|
+
idx = FQTIndex(bbox=WORLD)
|
|
370
|
+
|
|
371
|
+
obj1, box1 = "obj1", (10.0, 10.0, 20.0, 20.0)
|
|
372
|
+
obj2, box2 = "obj2", (30.0, 30.0, 40.0, 40.0)
|
|
373
|
+
|
|
374
|
+
idx.insert(obj1, box1)
|
|
375
|
+
idx.insert(obj2, box2)
|
|
376
|
+
|
|
377
|
+
# Remove using tuple
|
|
378
|
+
idx.remove(obj1, box1)
|
|
379
|
+
|
|
380
|
+
# Remove using list
|
|
381
|
+
box2_list = [30.0, 30.0, 40.0, 40.0]
|
|
382
|
+
idx.remove(obj2, box2_list)
|
|
383
|
+
|
|
384
|
+
# Both objects should be removed
|
|
385
|
+
assert idx.intersect((0.0, 0.0, 100.0, 100.0)) == []
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
def test_insert_list_and_tuple_equivalence():
|
|
389
|
+
"""Test that both list and tuple inputs for bbox work the same in insert."""
|
|
390
|
+
idx = FQTIndex(bbox=WORLD)
|
|
391
|
+
|
|
392
|
+
obj1, box1 = "obj1", (10.0, 10.0, 20.0, 20.0)
|
|
393
|
+
obj2, box2 = "obj2", [30.0, 30.0, 40.0, 40.0] # box2 as list
|
|
394
|
+
|
|
395
|
+
# Insert using tuple
|
|
396
|
+
idx.insert(obj1, box1)
|
|
397
|
+
|
|
398
|
+
# Insert using list
|
|
399
|
+
idx.insert(obj2, box2)
|
|
400
|
+
|
|
401
|
+
# Both objects should be present
|
|
402
|
+
results = idx.intersect((0.0, 0.0, 100.0, 100.0))
|
|
403
|
+
assert set(results) == {obj1, obj2}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|