spatial-graph 0.0.4__tar.gz → 0.0.5__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 (43) hide show
  1. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/.github/workflows/ci.yml +6 -1
  2. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/.pre-commit-config.yaml +2 -2
  3. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/Dockerfile +15 -11
  4. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/PKG-INFO +1 -1
  5. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/src/rtree.h +3 -2
  6. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/wrapper_template.pyx +6 -10
  7. spatial_graph-0.0.5/src/spatial_graph/py.typed +0 -0
  8. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/.github/workflows/docs.yaml +0 -0
  9. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/.gitignore +0 -0
  10. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/LICENSE +0 -0
  11. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/README.md +0 -0
  12. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/docs/index.md +0 -0
  13. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/examples/basic_usage.py +0 -0
  14. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/examples/query_nearest_vispy.py +0 -0
  15. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/mkdocs.yml +0 -0
  16. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/pyproject.toml +0 -0
  17. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/__init__.py +0 -0
  18. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_dtypes.py +0 -0
  19. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_graph/__init__.py +0 -0
  20. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_graph/graph.py +0 -0
  21. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_graph/graph_base.py +0 -0
  22. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_graph/src/LICENSE.txt +0 -0
  23. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_graph/src/graph_lite.h +0 -0
  24. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_graph/views.py +0 -0
  25. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_graph/wrapper_template.pyx +0 -0
  26. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/__init__.py +0 -0
  27. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/line_rtree.py +0 -0
  28. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/point_rtree.py +0 -0
  29. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/rtree.py +0 -0
  30. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/src/ARCHITECTURE.md +0 -0
  31. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/src/LICENSE +0 -0
  32. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/src/config.h +0 -0
  33. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/src/rtree.c +0 -0
  34. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_rtree/tree_base.py +0 -0
  35. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_spatial_graph.py +0 -0
  36. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/src/spatial_graph/_util.py +0 -0
  37. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/tests/test_attributes.py +0 -0
  38. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/tests/test_bench.py +0 -0
  39. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/tests/test_dtype.py +0 -0
  40. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/tests/test_graph.py +0 -0
  41. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/tests/test_invalid_inputs.py +0 -0
  42. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/tests/test_rtree.py +0 -0
  43. {spatial_graph-0.0.4 → spatial_graph-0.0.5}/tests/test_spatial_graph.py +0 -0
@@ -95,7 +95,12 @@ jobs:
95
95
  files: "./dist/*"
96
96
 
97
97
  docker-test:
98
+ name: Docker Test gxx${{ matrix.gxx_major }}
98
99
  runs-on: ubuntu-latest
100
+ strategy:
101
+ fail-fast: false
102
+ matrix:
103
+ gxx_major: [14, 15]
99
104
 
100
105
  steps:
101
106
  - name: Checkout code
@@ -103,5 +108,5 @@ jobs:
103
108
 
104
109
  - name: Build and test Docker image
105
110
  run: |
106
- docker build -t spatial_graph .
111
+ docker build --build-arg GXX_MAJOR=${{ matrix.gxx_major }} -t spatial_graph .
107
112
  docker run --rm spatial_graph
@@ -15,13 +15,13 @@ repos:
15
15
  - id: check-added-large-files
16
16
 
17
17
  - repo: https://github.com/astral-sh/ruff-pre-commit
18
- rev: v0.12.2
18
+ rev: v0.12.7
19
19
  hooks:
20
20
  - id: ruff-check
21
21
  args: [--fix, --unsafe-fixes]
22
22
  - id: ruff-format
23
23
 
24
24
  - repo: https://github.com/pre-commit/mirrors-mypy
25
- rev: v1.16.1
25
+ rev: v1.17.1
26
26
  hooks:
27
27
  - id: mypy
@@ -4,32 +4,36 @@ ENV DEBIAN_FRONTEND=noninteractive \
4
4
  MAMBA_ROOT_PREFIX=/opt/conda \
5
5
  PATH=/opt/conda/bin:$PATH
6
6
 
7
+ # Allow overriding the major GCC/G++ version at build time (e.g. --build-arg GXX_MAJOR=14)
8
+ ARG GXX_MAJOR=15
9
+
7
10
  RUN apt-get update && \
8
11
  apt-get install -y --no-install-recommends \
9
12
  git curl tar bzip2 ca-certificates && \
10
13
  rm -rf /var/lib/apt/lists/*
11
14
 
15
+
16
+ WORKDIR /app
17
+ COPY . /app
18
+
12
19
  # auto-detect arch and grab the matching micromamba binary
13
20
  RUN set -eux; \
14
21
  arch="$(uname -m)"; \
15
22
  case "$arch" in \
16
- x86_64) url_arch=linux-64 ;; \
17
- aarch64|arm64) url_arch=linux-aarch64 ;; \
18
- ppc64le) url_arch=linux-ppc64le ;; \
19
- *) echo "Unsupported arch: $arch"; exit 1 ;; \
23
+ x86_64) url_arch=linux-64; gxx_pkg=gxx_linux-64 ;; \
24
+ aarch64|arm64) url_arch=linux-aarch64; gxx_pkg=gxx_linux-aarch64 ;; \
25
+ ppc64le) url_arch=linux-ppc64le; gxx_pkg=gxx_linux-ppc64le ;; \
26
+ *) echo "Unsupported arch: $arch"; exit 1 ;; \
20
27
  esac; \
21
28
  curl -Ls "https://micro.mamba.pm/api/micromamba/$url_arch/latest" \
22
29
  | tar -xvj -C /usr/local/bin bin/micromamba; \
23
30
  chmod +x /usr/local/bin/bin/micromamba; \
24
31
  mv /usr/local/bin/bin/micromamba /usr/local/bin/micromamba; \
25
- rmdir /usr/local/bin/bin
26
-
27
-
28
- WORKDIR /app
29
- COPY . /app
32
+ rmdir /usr/local/bin/bin; \
33
+ micromamba create -y -n test-env -c conda-forge \
34
+ python=3.12 pip gxx "${gxx_pkg}=${GXX_MAJOR}.*"; \
35
+ micromamba run -n test-env pip install -e . --group test
30
36
 
31
- RUN micromamba create -y -n test-env -c conda-forge python=3.12 pip compilers
32
- RUN micromamba run -n test-env pip install -e . --group test
33
37
 
34
38
  SHELL ["micromamba", "run", "-n", "test-env", "/bin/bash", "-o", "pipefail", "-c"]
35
39
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spatial-graph
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: A spatial graph datastructure for python.
5
5
  Project-URL: homepage, https://github.com/funkelab/spatial_graph
6
6
  Project-URL: repository, https://github.com/funkelab/spatial_graph
@@ -6,6 +6,7 @@
6
6
  #define RTREE_H
7
7
 
8
8
  #include <stdlib.h>
9
+ #include <stdbool.h>
9
10
  #include "config.h"
10
11
 
11
12
  // rtree_new returns a new rtree
@@ -83,8 +84,8 @@ int rtree_delete(struct rtree *tr, const coord_t *min, const coord_t *max, const
83
84
  // rectangle, and perform a comparison of its data to the provided data using
84
85
  // a compare function. The first item that is found is deleted.
85
86
  //
86
- // Returns false if the system is out of memory.
87
- bool rtree_delete_with_comparator(struct rtree *tr, const coord_t *min,
87
+ // Returns the number of deleted items (0 or 1) or -1 if an OOM error occured.
88
+ int rtree_delete_with_comparator(struct rtree *tr, const coord_t *min,
88
89
  const coord_t *max, const item_t item,
89
90
  int (*compare)(const item_t a, const item_t b, void *udata),
90
91
  void *udata);
@@ -1,19 +1,15 @@
1
1
  from libc.stdint cimport *
2
+ from libcpp cimport bool
2
3
  import numpy as np
3
4
 
4
-
5
- ctypedef int bool
6
-
7
5
  cdef extern from *:
8
6
  """
9
- typedef int bool;
10
- #define false 0
11
- #define true 1
12
-
13
7
  %if $c_distance_function
14
8
  #define KNN_USE_EXACT_DISTANCE
15
9
  %end if
16
10
  #define DIMS $dims
11
+ #include <stdbool.h>
12
+ #include <string.h>
17
13
 
18
14
  typedef $coord_dtype.to_pyxtype() coord_t;
19
15
  typedef $item_dtype.base_c_type item_base_t;
@@ -152,7 +148,7 @@ cdef pyx_items_t memview_to_pyx_items_t($item_dtype.to_pyxtype(add_dim=True) ite
152
148
  %end if
153
149
 
154
150
 
155
- cdef bint count_iterator(
151
+ cdef bool count_iterator(
156
152
  const coord_t* bb_min,
157
153
  const coord_t* bb_max,
158
154
  const item_t item,
@@ -174,7 +170,7 @@ cdef init_search_results_from_memview(search_results* r, $item_dtype.to_pyxtype(
174
170
  r.items = memview_to_pyx_items_t(items)
175
171
 
176
172
 
177
- cdef bint search_iterator(
173
+ cdef bool search_iterator(
178
174
  const coord_t* bb_min,
179
175
  const coord_t* bb_max,
180
176
  const item_t item,
@@ -203,7 +199,7 @@ cdef init_nearest_results_from_memview(nearest_results* r,
203
199
  r.distances = &distances[0] if distances is not None else NULL
204
200
 
205
201
 
206
- cdef bint nearest_iterator(
202
+ cdef bool nearest_iterator(
207
203
  const item_t item,
208
204
  coord_t distance,
209
205
  void* udata
File without changes
File without changes
File without changes
File without changes
File without changes