Skip to content

Update python APIs to make init return a RecordingHandle which manages most state #1903

@jleibs

Description

@jleibs

The idea is that the RecordingHandle would be locked to a single recording-id and as long as it's held can continue to be used for logging without some other context (i.e. another jupyter notebook cell) clobbering the sink in the global rerun context)

The basic idea is to enable usage along the lines of the following:

rec1 = rr.init(sink=Tcp)
rec2 = rr.init(sink=File('my.rrd'), make_default=False)
rec3 = rr.init(sink=Memory, make_default=False)

# Different ways to log to a specific recording

rr.log_points(... , recording=rec1)

rec2.log_points(...)

with rec1:  # temporarily pushes the new recording onto a stack for this thread
  rr.log_points(...)

# Or the global default can still be updated, which is the sink used 
rr.set_default_recording(rec3)

Metadata

Metadata

Assignees

Labels

notebookJupyter notebooks etcsdk-pythonPython logging API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions