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
Checkout the Github repository:
git clone git@github.com:rerun-io/rerun.git
Building
To build from source and install Rerun into your current Python environment run:
python3 -m pip install --upgrade pip
pip3 install maturin "./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!
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.67
If you want to switch back, this is how:
rustup set default-host x86_64-apple-darwin && rustup install 1.67
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.2.0a5-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f7b46decdb2a96b4d16e861130d7e12ecc7ea2bcb987673f795a0dbe8a42782 |
|
MD5 | f8985804237b97cc4364a0908ba3b191 |
|
BLAKE2b-256 | 2b4f9a1452baa0b3e43d61acb21cd68a3afd612a80b7cdb6412093de23c63d1d |
Hashes for rerun_sdk-0.2.0a5-cp38-abi3-manylinux_2_35_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 982401a2c4354d29f2cb7fc82280b4849995cd495bbea9cadd61d33d10d23f35 |
|
MD5 | cc4fa9f9bc71e4df97cfbae28b251a92 |
|
BLAKE2b-256 | 3d5694e6ed200ada0e22eb3a8fb2a17d63070c9c1344411b9e4de1d2ea1708b0 |
Hashes for rerun_sdk-0.2.0a5-cp38-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1c62d4375e756877e4f9ba01812dd6f86a1f3b859df6e49a094cd5411dd0113 |
|
MD5 | 8f50a00c900b722f8f94ecaec5005263 |
|
BLAKE2b-256 | 52475426b3b3cd5f72f385b773398de46cede05215c048d4fb2811fc0bae0228 |