pointgrid-rs
High-performance Rust implementation of deterministic point-grid alignment and numerical primitives for semantic maps.
Overview
pointgrid-rs provides fast, deterministic algorithms for:
- Point-grid alignment: Maps 2D points to a checkerboard grid pattern
- 1D uniform filtering: Scipy-compatible filtering with reflect/wrap boundary modes
- Linear sum assignment: Optimal assignment solver for cost matrices
This package is a drop-in replacement for the Python pointgrid package, offering 700x faster performance on large datasets.
Installation
pip install pointgrid-rs
Usage
Point-Grid Alignment
import numpy as np
import pointgrid_rs
points = np.array([[0.0, 0.0], [0.1, 0.2], [0.9, 1.0], [0.4, 0.6]])
aligned = pointgrid_rs.align_points_to_grid(points)
# Returns: array([[0.12857143, 0. ],
# [0. , 0.14285714],
# [0.64285714, 0.85714286],
# [0.38571429, 0.57142857]])
Uniform Filter
values = np.array([1.0, 2.0, 3.0, 4.0])
filtered = pointgrid_rs.uniform_filter1d(values, [4], size=3, axis=0, mode='reflect')
# Returns: array([1.33333333, 2. , 3. , 3.66666667])
Linear Sum Assignment
costs = np.array([[4.0, 1.0, 3.0],
[2.0, 0.0, 5.0],
[3.0, 2.0, 2.0]])
assignment = pointgrid_rs.linear_sum_assignment(costs)
# Returns: array([1, 0, 2])
Performance
Benchmark on 10,000 points:
| Implementation | Time |
|---|---|
| Python pointgrid | 2,756 ms |
| Rust pointgrid-rs | 4.3 ms |
Speedup: 700x faster
API Reference
align_points_to_grid(points: np.ndarray) -> np.ndarray
Aligns 2D points to a deterministic checkerboard grid pattern.
Parameters:
points: numpy array of shape (n, 2) containing 2D coordinates
Returns:
- numpy array of shape (n, 2) with aligned coordinates
uniform_filter1d(values: np.ndarray, shape: list, size: int, axis: int, mode: str) -> np.ndarray
Applies a uniform (box) filter along a specified axis with boundary handling.
Parameters:
values: 1D numpy array of valuesshape: list specifying the shape of the multi-dimensional arraysize: size of the uniform filter kernelaxis: axis along which to apply the filtermode: boundary mode, either 'reflect' or 'wrap'
Returns:
- 1D numpy array with filtered values
linear_sum_assignment(costs: np.ndarray) -> np.ndarray
Solves the linear sum assignment problem (Hungarian algorithm).
Parameters:
costs: 2D numpy array of shape (n, n) containing the cost matrix
Returns:
- 1D numpy array where result[i] is the column assigned to row i
License
MIT
Acknowledgements
This is a Rust reimplementation of the original pointgrid Python package by the Yale DHLab.
Metadata
Release files for pointgrid-rs 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pointgrid_rs-0.1.5.tar.gz | 9.2 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pointgrid_rs-0.1.5-cp314-cp314-macosx_11_0_arm64.whl | CPython 3.14 | CPython 3.14 | macOS 11.0+ ARM64 | Details |
| pointgrid_rs-0.1.5-cp313-cp313-manylinux_2_34_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.34+ x86-64 | Details |
| pointgrid_rs-0.1.5-cp313-cp313-macosx_11_0_arm64.whl | CPython 3.13 | CPython 3.13 | macOS 11.0+ ARM64 | Details |
| pointgrid_rs-0.1.5-cp312-cp312-manylinux_2_34_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.34+ x86-64 | Details |
| pointgrid_rs-0.1.5-cp312-cp312-macosx_11_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 11.0+ ARM64 | Details |
| pointgrid_rs-0.1.5-cp311-cp311-manylinux_2_34_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.34+ x86-64 | Details |
| pointgrid_rs-0.1.5-cp311-cp311-macosx_11_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 11.0+ ARM64 | Details |
Total release size: 2.1 MB
Release files / pointgrid_rs-0.1.5.tar.gz
| Download URL | pointgrid_rs-0.1.5.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0803ab6ca07a0c0ea458ad8185935a2dfa1fb9da2473b1bd98e6a1efc162d0d
|
|
BLAKE2b-256 checksum How to use checksums |
3f2b6df3bb761e2d7a8e9bd38da017fd506b992796432d1118f30f732432e059
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / pointgrid_rs-0.1.5-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | pointgrid_rs-0.1.5-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 248.1 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ee45eba50b559c20688540f5fcfff612e493eb6dc040ed66ffda30ec4b0c286a
|
|
BLAKE2b-256 checksum How to use checksums |
fc96013cf5ea266427e50f1d769e5fbe153e0a67b992ba8539b836f73d50a269
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / pointgrid_rs-0.1.5-cp313-cp313-manylinux_2_34_x86_64.whl
| Download URL | pointgrid_rs-0.1.5-cp313-cp313-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 331.8 kB |
| Tags | CPython 3.13 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
a1451e9e7c2a6704d1eb8c0cb0d2cfd3f5780cdf971d14205c268dd397bc3a7b
|
|
BLAKE2b-256 checksum How to use checksums |
acb19070a0ae8143b636f5893abf133142836a5d981c292e3cf6beced7248176
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / pointgrid_rs-0.1.5-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pointgrid_rs-0.1.5-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 282.8 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
bb35dcee48bba3b2ea898d54f5d4fc96197614415d463b4b619ce86321f23eef
|
|
BLAKE2b-256 checksum How to use checksums |
d4ba817be832c240578263eebb0f80a789a93cec8fee3f81674503d2e920fdc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / pointgrid_rs-0.1.5-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | pointgrid_rs-0.1.5-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 332.2 kB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
4646d31967989e0c0bc45f874dc6176b4ea23f5a38069512d73cecef9d701258
|
|
BLAKE2b-256 checksum How to use checksums |
470556bac72f0b5a0009b3b77482b10083b8cf4dc8f8fd04596abf41d93df627
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / pointgrid_rs-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pointgrid_rs-0.1.5-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 282.3 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
142dd9ba841de945fcc0ec773a6cab9d8851f4a524e44180eead558572f7018d
|
|
BLAKE2b-256 checksum How to use checksums |
30488e499d6b60c0b38c4ae48675927d09a1f2c542baa6401491a6b20ce1f790
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / pointgrid_rs-0.1.5-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | pointgrid_rs-0.1.5-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 332.4 kB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
c9ca74fe79dd33467aa726cea28e697be1277da54e19fb928d41a74ca89a7947
|
|
BLAKE2b-256 checksum How to use checksums |
38ba2631e78722b1088a1986687b7aab971ae8f05419cff3f0a8cec6e9589219
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / pointgrid_rs-0.1.5-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pointgrid_rs-0.1.5-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 285.7 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
67b38bed91bfe287278b35be3a3d6db995e4db67015fce1cb1958ba14c1f096e
|
|
BLAKE2b-256 checksum How to use checksums |
6926c9e1cf1c3bf1b3687aa94ef770aa17608bdfb852d2c8b543b6e2680e5bfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|