Skip to content

Conversation

@dianchia
Copy link

@dianchia dianchia commented Feb 3, 2026

This PR exposes the Rust core and domain logic introduced in #1188 to Python via PyO3, while keeping the Python SDK behaviour unchanged.

Key points:

  • Implements the Tables struct as a Python extension, encapsulating
    • JSON loading from the nuScenes dataset
    • The get method for retrieving table entries via token
    • Pickling support via __getstate__, __setstate__, and __reduce__
  • Introduces lazy "proxy" objects for all tables:
    • Each table has a View and an Iter struct
    • Only requested entries are converted into Python dictionaries
    • This avoids eagerly materialising all table data into Python dictionaries, thus reducing memory footprint.
  • Maintains compatibility with existing Python SDK behaviour; no changes to public APIs are made
  • This PR is purely a Python binding exposure layer -- integration with the main NuScenes class is not included.

The goal of this PR is to safely expose the Rust implementation to Python while retaining identical runtime behaviour for current users and enabling efficient, lazy access to table data.

Configure Cargo.toml and pyproject.toml for PyO3 extension.
Include a CI workflow for building wheels with maturin for different OS and Python versions.
- Implement nuScenes core data structures such as Scene, Sample, SampleAnnotation, etc.
Implement domain logics:
- Convert from model struct to domain struct.
- Add fields for "shortcuts" between tables.
Glue Rust domain into Python.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant