Skip to main content

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 values
  • shape: list specifying the shape of the multi-dimensional array
  • size: size of the uniform filter kernel
  • axis: axis along which to apply the filter
  • mode: 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pointgrid_rs-0.1.4.tar.gz (8.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pointgrid_rs-0.1.4-cp313-cp313-manylinux_2_34_x86_64.whl (328.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

pointgrid_rs-0.1.4-cp313-cp313-macosx_11_0_arm64.whl (246.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pointgrid_rs-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl (328.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

pointgrid_rs-0.1.4-cp312-cp312-macosx_11_0_arm64.whl (280.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pointgrid_rs-0.1.4-cp311-cp311-manylinux_2_34_x86_64.whl (329.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

pointgrid_rs-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (284.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file pointgrid_rs-0.1.4.tar.gz.

File metadata

  • Download URL: pointgrid_rs-0.1.4.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for pointgrid_rs-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d403cbfd81f7e371ef817aaac3309f8d08c90305574aaf1c8a56b0dfe571e2f5
MD5 bb2c1a87b0e22a5323856fe71038eeb5
BLAKE2b-256 b61b501ca1129efc94c344a8ea8b4269eedc9fe5540883f7d35060958a11fa83

See more details on using hashes here.

File details

Details for the file pointgrid_rs-0.1.4-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pointgrid_rs-0.1.4-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bc34d7d366eae091f76087e039f2d735e633fb8252966521cc2efee10653678f
MD5 c71b4fd2ec5f56096cf19e327074302c
BLAKE2b-256 4defb370c6a6419b2b65c6fe6ed7d3f7335c434969e84b515adb0073aeb99296

See more details on using hashes here.

File details

Details for the file pointgrid_rs-0.1.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointgrid_rs-0.1.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4dfd76db5f1eaebb8c4ce378a8955382902bcf962fa5c48493907aebb34bcf9c
MD5 b282a93269e17ed6541e37fd500250e0
BLAKE2b-256 20c8cd6c1adfa7870ae4811fb332b44e72167852543fa535f976e2b5ff711a02

See more details on using hashes here.

File details

Details for the file pointgrid_rs-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pointgrid_rs-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8fa6c5c793d75017fe3befbadc1f730c51e51549cb6d8f094c23a658c8ccf726
MD5 57101e9dc6c3fe6d03aeb8261fbd4f3b
BLAKE2b-256 b421d5277d733c057cf3e042d0a047657a964ab78006af363e1e0eb20047f735

See more details on using hashes here.

File details

Details for the file pointgrid_rs-0.1.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointgrid_rs-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3efc3dc14b1052c1ea51af34ef34a77f6f82f38b2d4532ca7f5c512c31bde7fb
MD5 a40a52ab6989265fb6704e522508b576
BLAKE2b-256 ecda62459714de67f9bd2cd0884bcfe751cf5f4fd303dda3a7f52624e18af038

See more details on using hashes here.

File details

Details for the file pointgrid_rs-0.1.4-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pointgrid_rs-0.1.4-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8fc915e6183e3da1daecea821575a36931352debc114a4ee88041a834982ea0f
MD5 7151ed787bf3a447863e15261f77298c
BLAKE2b-256 81793b5bfae3a96dee4d7300681fc7da1fd09ca1cb9c20940726903f46e6c7c3

See more details on using hashes here.

File details

Details for the file pointgrid_rs-0.1.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointgrid_rs-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be5508b86fdaa28837067ad21bd529511696ad644a3c560763c1aac5869a451b
MD5 321e6a4d48a1656cdce45941b69b073e
BLAKE2b-256 ff3f952826b3597405d74e3d7ed4d6d653bf7e3d354a4e8ca067934855b1e3a2

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.5

8 files

This release

0.1.4 This release

7 files

0.1.3

5 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page