Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jleibs opened this issue Apr 18, 2023 · 1 comment · Fixed by #2061
Closed

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

jleibs opened this issue Apr 18, 2023 · 1 comment · Fixed by #2061
Assignees
Labels
notebook Jupyter notebooks etc 🐍 Python API Python logging API

Comments

@jleibs
Copy link
Member

jleibs commented Apr 18, 2023

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)
@emilk emilk added the 🐍 Python API Python logging API label Apr 18, 2023
@emilk
Copy link
Member

emilk commented Apr 18, 2023

Related to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notebook Jupyter notebooks etc 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants