fastquadtree 1.0.1__tar.gz → 1.0.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.
Files changed (72) hide show
  1. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/Cargo.lock +1 -1
  2. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/Cargo.toml +1 -1
  3. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/PKG-INFO +1 -1
  4. fastquadtree-1.0.2/docs/future_features.md +30 -0
  5. fastquadtree-1.0.2/docs/styles/overrides.css +38 -0
  6. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/mkdocs.yml +14 -1
  7. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/pysrc/fastquadtree/_item.py +15 -5
  8. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/.github/workflows/docs.yml +0 -0
  9. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/.github/workflows/release.yml +0 -0
  10. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/.gitignore +0 -0
  11. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/.pre-commit-config.yaml +0 -0
  12. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/LICENSE +0 -0
  13. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/README.md +0 -0
  14. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/assets/ballpit.png +0 -0
  15. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/assets/interactive_v2_rect_screenshot.png +0 -0
  16. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/assets/interactive_v2_screenshot.png +0 -0
  17. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/assets/quadtree_bench_throughput.png +0 -0
  18. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/assets/quadtree_bench_time.png +0 -0
  19. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/benchmarks/benchmark_native_vs_shim.py +0 -0
  20. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/benchmarks/cross_library_bench.py +0 -0
  21. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/benchmarks/quadtree_bench/__init__.py +0 -0
  22. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/benchmarks/quadtree_bench/engines.py +0 -0
  23. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/benchmarks/quadtree_bench/main.py +0 -0
  24. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/benchmarks/quadtree_bench/plotting.py +0 -0
  25. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/benchmarks/quadtree_bench/runner.py +0 -0
  26. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/benchmarks/requirements.txt +0 -0
  27. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/benchmarks/runner.py +0 -0
  28. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/benchmarks/system_info_collector.py +0 -0
  29. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/docs/api/point_item.md +0 -0
  30. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/docs/api/pyqtree.md +0 -0
  31. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/docs/api/quadtree.md +0 -0
  32. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/docs/api/rect_item.md +0 -0
  33. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/docs/api/rect_quadtree.md +0 -0
  34. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/docs/benchmark.md +0 -0
  35. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/docs/index.md +0 -0
  36. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/docs/quickstart.md +0 -0
  37. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/docs/runnables.md +0 -0
  38. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/interactive/ballpit.py +0 -0
  39. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/interactive/interactive.py +0 -0
  40. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/interactive/interactive_v2.py +0 -0
  41. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/interactive/interactive_v2_rect.py +0 -0
  42. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/interactive/requirements.txt +0 -0
  43. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/pyproject.toml +0 -0
  44. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/pysrc/fastquadtree/__init__.py +0 -0
  45. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/pysrc/fastquadtree/_base_quadtree.py +0 -0
  46. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/pysrc/fastquadtree/_obj_store.py +0 -0
  47. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/pysrc/fastquadtree/point_quadtree.py +0 -0
  48. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/pysrc/fastquadtree/py.typed +0 -0
  49. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/pysrc/fastquadtree/pyqtree.py +0 -0
  50. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/pysrc/fastquadtree/rect_quadtree.py +0 -0
  51. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/src/geom.rs +0 -0
  52. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/src/lib.rs +0 -0
  53. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/src/quadtree.rs +0 -0
  54. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/src/rect_quadtree.rs +0 -0
  55. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/insertions.rs +0 -0
  56. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/nearest_neighbor.rs +0 -0
  57. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/query.rs +0 -0
  58. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/rect_quadtree.rs +0 -0
  59. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/rectangle_traversal.rs +0 -0
  60. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_base_quadtree.py +0 -0
  61. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_clear.py +0 -0
  62. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_delete.rs +0 -0
  63. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_delete_by_object.py +0 -0
  64. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_delete_python.py +0 -0
  65. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_obj_store.py +0 -0
  66. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_point_quadtree_nn_runtime.py +0 -0
  67. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_pyqtree_shim_compat.py +0 -0
  68. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_python.py +0 -0
  69. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_rect_quadtree.py +0 -0
  70. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_unconventional_bounds.py +0 -0
  71. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/test_wrapper_edges.py +0 -0
  72. {fastquadtree-1.0.1 → fastquadtree-1.0.2}/tests/unconventional_bounds.rs +0 -0
@@ -10,7 +10,7 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
10
10
 
11
11
  [[package]]
12
12
  name = "fastquadtree"
13
- version = "1.0.1"
13
+ version = "1.0.2"
14
14
  dependencies = [
15
15
  "pyo3",
16
16
  "smallvec",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "fastquadtree"
3
- version = "1.0.1"
3
+ version = "1.0.2"
4
4
  edition = "2021"
5
5
  readme = "README.md"
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastquadtree
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3 :: Only
6
6
  Classifier: Programming Language :: Rust
@@ -0,0 +1,30 @@
1
+ # Future Features
2
+
3
+ Below are a list of features that may be added to future versions of this project.
4
+ If you really want any of these features, please let us know by opening an issue.
5
+
6
+ If you have any suggestions or would like to contribute, please feel free to open an issue or a pull request.
7
+
8
+ ## Planned Features
9
+
10
+ ### 1. Quadtree serialization
11
+
12
+ By serializing the quadtree, we can save its state to a file and load it later. This will allow us to persist the quadtree structure and data across sessions. For example, you could pre build a quadtree with all the walls in your video game level, serialize it to a file, and then load it when the game starts. This will heavily reduce the game load time since you won't have to rebuild the quadtree from scratch every time.
13
+
14
+ ### 2. Circle support
15
+
16
+ Currently, we support points and rectangles in two separate quadtrees.
17
+ For example, in the ball-pit demo, we use a point quadtree, but then query a larger area to account for the radius of the balls.
18
+ With a circle quadtree, we could directly insert circles and perform circle-circle collision detection.
19
+
20
+ ### 3. KNN with criteria function
21
+
22
+ Currently, KNN only supports finding the nearest neighbors based on euclidean distance.
23
+ By adding a criteria function, we could allow users to define custom criteria for finding neighbors by passing a function that
24
+ takes in a point and returns a score. The KNN algorithm would then use this score to determine the nearest neighbors.
25
+
26
+ ### 4. KNN in rectangle quadtree
27
+
28
+ Currently, KNN is only supported in the point quadtree. By adding KNN support to the rectangle quadtree, we could allow users to find the nearest rectangles to a given point. This would be to the nearest edge of the rectangle, adding complexity to the algorithm.
29
+ However, it will allow for really quick collision detection between a point and a set of rectangles as the point can just do
30
+ robust-collision handling with the nearest rectangles.
@@ -0,0 +1,38 @@
1
+ /* Global typography tuning */
2
+ :root {
3
+ /* Larger base size for body copy */
4
+ --md-typeset-font-size: 0.98rem; /* default ~0.9-0.95 */
5
+ }
6
+
7
+ .md-typeset {
8
+ line-height: 1.65; /* more relaxed, better for focus */
9
+ letter-spacing: 0.001em;
10
+ }
11
+
12
+ /* Crisper headings without looking heavy */
13
+ .md-typeset h1, .md-typeset h2, .md-typeset h3 {
14
+ font-weight: 700;
15
+ line-height: 1.25;
16
+ }
17
+
18
+ /* Improve contrast on body text and links */
19
+ :root {
20
+ --md-default-fg-color: rgba(0,0,0,0.86);
21
+ --md-default-fg-color--light: rgba(0,0,0,0.64);
22
+ --md-typeset-a-color: #1e40af; /* indigo-800 like */
23
+ }
24
+ [data-md-color-scheme="slate"] {
25
+ --md-default-fg-color: rgba(255,255,255,0.92);
26
+ --md-default-fg-color--light: rgba(255,255,255,0.72);
27
+ --md-typeset-a-color: #93c5fd; /* lighter link on dark */
28
+ }
29
+
30
+ /* Make code a tad larger for readability */
31
+ .md-typeset code, .md-typeset pre code {
32
+ font-size: 0.93em;
33
+ }
34
+
35
+ /* Slightly stronger nav text */
36
+ .md-nav__item .md-nav__link {
37
+ font-weight: 500;
38
+ }
@@ -15,10 +15,18 @@ theme:
15
15
  - toc.integrate
16
16
  - search.suggest
17
17
  - search.highlight
18
+ - content.tooltips
18
19
  palette:
19
20
  - scheme: slate
20
21
  primary: indigo
21
22
  accent: deep orange
23
+ font:
24
+ text: Inter
25
+ code: JetBrains Mono
26
+
27
+ extra_css:
28
+ - styles/overrides.css
29
+
22
30
 
23
31
  plugins:
24
32
  - search
@@ -36,6 +44,11 @@ plugins:
36
44
  separate_signature: true
37
45
  line_length: 88
38
46
  heading_level: 2
47
+ filters: # Exclude __slots__ and __len__ and anything with a single underscore prefix
48
+ - "!__slots__"
49
+ - "!__len__"
50
+ - "!_.*"
51
+
39
52
  - autorefs
40
53
  - git-revision-date-localized:
41
54
  fallback_to_build_date: true
@@ -68,6 +81,7 @@ nav:
68
81
  - Quickstart: quickstart.md
69
82
  - Runnables: runnables.md
70
83
  - Benchmark: benchmark.md
84
+ - Future Features: future_features.md
71
85
  - API:
72
86
  - QuadTree: api/quadtree.md
73
87
  - RectQuadTree: api/rect_quadtree.md
@@ -83,5 +97,4 @@ extra:
83
97
  link: https://pypi.org/project/fastquadtree/
84
98
 
85
99
  # Build options
86
- extra_css: []
87
100
  extra_javascript: []
@@ -23,17 +23,22 @@ class Item:
23
23
  __slots__ = ("geom", "id_", "obj")
24
24
 
25
25
  def __init__(self, id_: int, geom: Point | Bounds, obj: Any | None = None):
26
- self.id_ = id_
27
- self.geom = geom
28
- self.obj = obj
26
+ self.id_: int = id_
27
+ self.geom: Point | Bounds = geom
28
+ self.obj: Any | None = obj
29
29
 
30
30
 
31
31
  class PointItem(Item):
32
32
  """
33
33
  Lightweight point item wrapper for tracking and as_items results.
34
+
35
+ Attributes:
36
+ id_: Integer identifier.
37
+ geom: The point geometry as (x, y).
38
+ obj: The attached Python object if available, else None.
34
39
  """
35
40
 
36
- __slots__ = ("geom", "id_", "obj", "x", "y")
41
+ __slots__ = ("x", "y")
37
42
 
38
43
  def __init__(self, id_: int, geom: Point, obj: Any | None = None):
39
44
  super().__init__(id_, geom, obj)
@@ -43,9 +48,14 @@ class PointItem(Item):
43
48
  class RectItem(Item):
44
49
  """
45
50
  Lightweight rectangle item wrapper for tracking and as_items results.
51
+
52
+ Attributes:
53
+ id_: Integer identifier.
54
+ geom: The rectangle geometry as (min_x, min_y, max_x, max_y
55
+ obj: The attached Python object if available, else None.
46
56
  """
47
57
 
48
- __slots__ = ("geom", "id_", "max_x", "max_y", "min_x", "min_y", "obj")
58
+ __slots__ = ("max_x", "max_y", "min_x", "min_y")
49
59
 
50
60
  def __init__(self, id_: int, geom: Bounds, obj: Any | None = None):
51
61
  super().__init__(id_, geom, obj)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes