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

More Viewer control in notebooks (recording id, panel states) #8917

Merged
merged 14 commits into from
Feb 4, 2025

Conversation

jprochazk
Copy link
Member

Related

What

This PR introduces the following notebook-only APIs:

  • Viewer.set_active_recording, allowing the user to programmatically choose the active recording in multi-recording scenarios.
  • Viewer.update_panels, exposing the ability to partially update the state of panels.
  • A use_global_recording param in the rerun.notebook.Viewer constructor, which allows the Viewer to be displayed in a "clean" state, without implicitly capturing any data from any recording. Recordings can then be added later using the existing Viewer.add_recording method.

I also discovered that our build script was subtly broken for a while now 😬 specifically, the CLOSURE_DTORS finalizer would throw an exception because wasm was null. Luckily it didn't cause any issues except for there being some error spam in the console.

@jprochazk jprochazk added notebook Jupyter notebooks etc include in changelog labels Feb 4, 2025
Copy link

github-actions bot commented Feb 4, 2025

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
b9a41c6 https://rerun.io/viewer/pr/8917 +nightly +main

Note: This comment is updated whenever you push a commit.

@jprochazk jprochazk added the 🐍 Python API Python logging API label Feb 4, 2025
@@ -190,6 +197,78 @@ def _repr_mimebundle_(self, **kwargs: dict) -> tuple[dict, dict] | None: # type
def _repr_keys(self): # type: ignore[no-untyped-def]
return self._viewer._repr_keys()

def update_panels(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A "partial update" API felt the most intuitive to me. This means that we need a way to differentiate between "don't update this panel state" (None) and "please reset this panel state" (default).

@jleibs jleibs self-requested a review February 4, 2025 18:56
Copy link
Member

@jleibs jleibs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice!

There does seem to be a lurking race-condition in here. The first recording only gets its time adjusted like half the time for me.

examples/python/notebook/cube.ipynb Outdated Show resolved Hide resolved
@jprochazk jprochazk merged commit f53e9f8 into main Feb 4, 2025
32 checks passed
@jprochazk jprochazk deleted the jan/notebook-rec-id branch February 4, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog notebook Jupyter notebooks etc 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add example/snippets demonstrating set_time_ctrl Add notebook support for set_active_recording_id
2 participants