Initialization functions
rerun
def init (application_id, *, recording_id=None, spawn=False, init_logging=True, default_enabled=True, strict=False, exp_init_blueprint=False, exp_add_to_app_default_blueprint=True)
Initialize the Rerun SDK with a user-chosen application id (name).
You must call this function first in order to initialize a global recording. Without an active recording, all methods of the SDK will turn into no-ops.
For more advanced use cases, e.g. multiple recordings setups, see rerun.new_recording
.
Warning
If you don't specify a recording_id
, it will default to a random value that is generated once
at the start of the process.
That value will be kept around for the whole lifetime of the process, and even inherited by all
its subprocesses, if any.
This makes it trivial to log data to the same recording in a multiprocess setup, but it also means that the following code will not create two distinct recordings:
rr.init("my_app")
rr.init("my_app")
To create distinct recordings from the same process, specify distinct recording IDs:
from uuid import uuid4
rr.init("my_app", recording_id=uuid4())
rr.init("my_app", recording_id=uuid4())
PARAMETER | DESCRIPTION |
---|---|
application_id |
Your Rerun recordings will be categorized by this application id, so try to pick a unique one for each application that uses the Rerun SDK. For example, if you have one application doing object detection
and another doing camera calibration, you could have
Application ids starting with
TYPE:
|
recording_id |
Set the recording ID that this process is logging to, as a UUIDv4. The default recording_id is based on If you are not using
TYPE:
|
spawn |
Spawn a Rerun Viewer and stream logging data to it.
Short for calling
TYPE:
|
default_enabled |
Should Rerun logging be on by default?
Can be overridden with the RERUN env-var, e.g.
TYPE:
|
init_logging |
Should we initialize the logging for this application?
TYPE:
|
strict |
If
TYPE:
|
exp_init_blueprint |
(Experimental) Should we initialize the blueprint for this application?
TYPE:
|
exp_add_to_app_default_blueprint |
(Experimental) Should the blueprint append to the existing app-default blueprint instead of creating a new one.
TYPE:
|
def connect (addr=None, *, flush_timeout_sec=2.0, recording=None)
Connect to a remote Rerun Viewer on the given ip:port.
Requires that you first start a Rerun Viewer by typing 'rerun' in a terminal.
This function returns immediately.
PARAMETER | DESCRIPTION |
---|---|
addr |
The ip:port to connect to
TYPE:
|
flush_timeout_sec |
The minimum time the SDK will wait during a flush before potentially
dropping data if progress is not being made. Passing
TYPE:
|
recording |
Specifies the
TYPE:
|
def disconnect (recording=None)
Closes all TCP connections, servers, and files.
Closes all TCP connections, servers, and files that have been opened with
[rerun.connect
], [rerun.serve
], [rerun.save
] or [rerun.spawn
].
PARAMETER | DESCRIPTION |
---|---|
recording |
Specifies the
TYPE:
|
def save (path, recording=None)
Stream all log-data to a file.
Call this before you log any data!
PARAMETER | DESCRIPTION |
---|---|
path |
The path to save the data to.
TYPE:
|
recording |
Specifies the
TYPE:
|