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.1-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a0858cd6fecbb6522227c55c491e4dd39e440d75a7406b2477fac4392f1c626 |
|
MD5 | 936aded9e60ea27ce3773a818336d163 |
|
BLAKE2b-256 | f65bb2b6c2c53b66cf5586315af7a8f4779249be455c024f50dc61cb77489294 |
Hashes for rerun_sdk-0.8.1-cp38-abi3-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e421ce8509b42459616031fefbadb14be1805e0c37cb9f2444b3766203b5416 |
|
MD5 | 051a7324378e67cee3733cd56f29264c |
|
BLAKE2b-256 | fcb37e0b289d570c7ae009c5498150725e2ae401e8feb4896e2c74e7e39d8271 |
Hashes for rerun_sdk-0.8.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52f7c567a201f876bb312bd31abb060b96a9de2e370a8d6e37c514ed86b3752c |
|
MD5 | e0af761c1375ea31888750c7a67f6e9c |
|
BLAKE2b-256 | d887b228a0819691ad9d97bd94c0b18c0c2ba502adcfd12834c0dc053c913801 |
Hashes for rerun_sdk-0.8.1-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 729da058a434d1685a400b1e65657670417de81bfc5d7e739f7ad6f232c84147 |
|
MD5 | a8ebdf80acdbe5b33244b32b38780e2f |
|
BLAKE2b-256 | 4a3875bc2be3a4f0beb52babf4c362bec4960381a204371ca072208a29c3f666 |