The simplest example is minimal
. You may want to start there!
Read more about our examples at https://www.rerun.io/examples.
First install the Rerun Python SDK with pip install rerun-sdk
or via conda
.
Note: Make sure your SDK version matches the code in the examples. For example, if your SDK version is
0.15.1
, check out the matching tag for this repository by runninggit checkout v0.15.1
.
Each example is packaged as a regular Python package, with a pyproject.toml
file specifying its required dependencies. To run an example, it must first be installed.
For example, to install dependencies and run the toy minimal
example (which doesn't need to download any data) run:
pip install -e examples/python/minimal
Note: it is import to install example in editable mode, which is done using the -e
flag (short for --editable
).
Once installed, the example can be run as a regular Python module:
python -m minimal
Examples also declare console script, so they can also be run directly:
minimal
By default, the examples spawn a Rerun Viewer and stream log data to it.
For most examples you can instead save the log data to an .rrd
file using plots --save data.rrd
. You can then view that .rrd
file with rerun data.rrd
.
(rerun
is an alias for python -m rerun
).
NOTE: .rrd
files do not yet guarantee any backwards or forwards compatibility. One version of Rerun will likely not be able to open an .rrd
file generated by another Rerun version.
The Rerun project makes extensive use of Pixi for various developer tasks, and Pixi can be used to run examples as well. For this, you need to install Pixi as per the installation instructions on their website.
The Pixi environment examples-pypi
will use the published Rerun SDK package from PyPI.
To use this environment, specify it when running the example:
pixi run -e examples-pypi minimal
Alternatively, you can build Rerun from source, and install it in the Pixi environment. Note that this requires a Rust toolchain to be installed on your system.
Before running the example, make sure the source build is up-to-date:
pixi run py-build-examples
Now you can run the example with the source build:
pixi run -e examples minimal
Some examples will download a small datasets before they run. They will do so the first time you run the example. The datasets will be added to a subdir called dataset
, which is in the repo-wide .gitignore
.
Feel free to open a PR to add a new example!
See CONTRIBUTING.md
for details on how to contribute.