The Rerun Logging SDK
Project description
The Rerun Python Log SDK
Rerun is an SDK for logging computer vision and robotics data paired with a visualizer for exploring that data over time. It lets you debug and understand the internal state and data of your systems with minimal code.
Install
pip3 install rerun-sdk
ℹ️ Note:
The Python module is called rerun
, while the package published on PyPI is rerun-sdk
.
Example
import rerun as rr
import numpy as np
rr.spawn()
positions = np.vstack([xyz.ravel() for xyz in np.mgrid[3 * [slice(-5, 5, 10j)]]]).T
colors = np.vstack([rgb.ravel() for rgb in np.mgrid[3 * [slice(0, 255, 10j)]]]).astype(np.uint8).T
rr.log_points("my_points", positions=positions, colors=colors)
Resources
Logging and viewing in different processes
You can run the viewer and logger in different processes.
In one terminal, start up a viewer with a server that the SDK can connect to:
python3 -m rerun
In a second terminal, run the example with the --connect
option:
python3 examples/python/car/main.py --connect
From Source
Setup:
- Install the Rust toolchain: https://rustup.rs/
git clone git@github.com:rerun-io/rerun.git && cd rerun
- Run
./scripts/setup_dev.sh
. - Make sure
cargo --version
prints1.69.0
once you are done
Building
To build from source and install Rerun into your current Python environment run:
python3 -m pip install --upgrade pip
pip3 install -r rerun_py/requirements-build.txt
pip3 install "./rerun_py"
ℹ️ Note:
If you are unable to upgrade pip to version >=21.3
, you need to pass --use-feature=in-tree-build
to the pip3 install
command.
Development
To set up a new virtualenv for development:
just py-dev-env
# For bash/zsh users:
source venv/bin/activate
# Or if you're using fish:
source venv/bin/activate.fish
Build, test, and run
For ease of development you can build and install in "editable" mode. This means you can edit the rerun
Python code without having to re-build and install to see changes.
# Build the SDK and install in develop mode into the virtualenv
# Re-run this if the Rust code has changed!
source venv/bin/activate
just py-build
Test
# Run the unit tests
just py-test
# Run the linting checks
just py-lint
# Run an example
python examples/python/car/main.py
Building an installable Python Wheel
The Python bindings to the core Rust library are built using https://github.com/PyO3/pyo3.
To build an installable Python wheel run:
pip install -r rerun_py/requirements-build.txt
maturin build -m rerun_py/Cargo.toml --release
By default the wheels will be built to target/wheels
(use the -o
flag to set a different output directory).
Now you can install rerun
in any Python3 environment using:
pip3 install target/wheels/*.whl
Viewing the docs locally
The rerun python docs are generated using mkdocs
Install the doc requirements:
pip install -r rerun_py/requirements-doc.txt
Serve the docs:
mkdocs serve -f rerun_py/mkdocs.yml -w rerun_py
or
just py-docs-serve
For information on how the docs system works, see: docs/docs.md
Troubleshooting
You can run with RUST_LOG=debug
to get more output out of the rerun SDK.
If you are using an Apple-silicon Mac, make sure rustc -vV
outputs host: aarch64-apple-darwin
. If not, this should fix it:
rustup set default-host aarch64-apple-darwin && rustup install 1.69
If you want to switch back, this is how:
rustup set default-host x86_64-apple-darwin && rustup install 1.69
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for rerun_sdk-0.8.2-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65e10bcb6b8513c0a8fb07c3ff7782652a3aed21dd92caf6ef933c3a4621fccc |
|
MD5 | e0612a0709a3905d6e24f3624066d921 |
|
BLAKE2b-256 | 4f8026445d3adcb1da240706820e8e38902e429567c75419445de05bc34cbc73 |
Hashes for rerun_sdk-0.8.2-cp38-abi3-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 806f5ee5e211f517d65bc277f47d29d3bb6f6f7c750e255e40da57e39d7ade1b |
|
MD5 | 0e34860b77c976d3b8d6129640146106 |
|
BLAKE2b-256 | 008d3fba2ea7ac70dff55a01dcc0639895903ca6684d0df0bb170fda6826aed5 |
Hashes for rerun_sdk-0.8.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da089f05eba1cea9dd8667a44abdf3dd7ea606affc12e8534efee1753c692509 |
|
MD5 | b2d1180196f6e3ca0b013d41918f432b |
|
BLAKE2b-256 | b140072d5d3751381a7287364b0a732b865ef5e2d62ac77aeab6687dfb18ce27 |
Hashes for rerun_sdk-0.8.2-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 999ea343db594e06fc71a9920d98ad1742335136195ed4324c3db9c7810583bb |
|
MD5 | 80af2d4dcd4853b771d8761da23ae9ed |
|
BLAKE2b-256 | fc7267367ed3da4c933bd500e0d56857b78c724fe618ecc4fa6c55075fb79a3b |