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

Add send_recording python api #9148

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Add send_recording python api #9148

wants to merge 10 commits into from

Conversation

oxkitsune
Copy link
Member

Related

Resolves #2044 somewhat

What

Adds api to send a recording loaded from RRD to a new recording stream, cloning the data in the process

@oxkitsune oxkitsune added 🐍 Python API Python logging API include in changelog 🪵 Log & send APIs Affects the user-facing API for all languages feat-dataframe-api Everything related to the dataframe API labels Feb 26, 2025
@oxkitsune oxkitsune changed the title Add send_recording python api Add send_recording python api Feb 26, 2025
Copy link

github-actions bot commented Feb 26, 2025

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

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

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

@Wumpf Wumpf self-requested a review March 3, 2025 11:23
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

Independent on whether we want to solve this differently in the future, the APIs are very valuable to have I believe.
There's some todos left though for documenting this out etc.
Also, I don't think we should close the linked issue until we implement this in all SDKs (right now the PR auto closes #2044)

@@ -472,6 +473,31 @@ def send_blueprint(
)


def send_recording(recording: Recording, stream: RecordingStream | None = None) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be mentioned in gen_common_index.py

Copy link
Member

Choose a reason for hiding this comment

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

Also, we need a snippet using this.
Ideally we'd add it to all languages if only to have the snippet comparision test do something - I figure at least for Rust we could whip up something?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added snippets for both rust/py 👍

@@ -472,6 +473,31 @@ def send_blueprint(
)


def send_recording(recording: Recording, stream: RecordingStream | None = None) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this Python function at all? Can this logic be done in the Rust implementation instead? @jleibs has recently implemented a bunch of APIs for the Python SDK that don't have a single line of Python in them (AFAIK?), and I would very much like to keep that trend...

Copy link
Member Author

Choose a reason for hiding this comment

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

I looked into it, but it doesn’t seem super straightforward in this case. There are a few things that make it a bit tricky, e.g. RecordingStream wrapping PyRecordingStream

Copy link
Member

Choose a reason for hiding this comment

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

Yes. This can only be done correctly once everything else is done correctly. By "correctly", I mean according to this issue:

@oxkitsune oxkitsune force-pushed the gijs/to-stream branch 2 times, most recently from d4e6138 to b727ab8 Compare March 5, 2025 11:06
@@ -488,6 +490,31 @@ def send_blueprint(
)


def send_recording(embedded_recording: Recording, recording: RecordingStream | None = None) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

This absolutely needs to also be a RecordingStream method.

Also, I don't know if this has been discussed, but our naming is all over the place, as this signature makes it explicit.

As they say, in for a penny, in for a pound. My actionable (if drastic) suggestion is either:

  • either rename all recording: RecordingStream arguments of the stateful API to stream: RecordingStream,
  • or preferably remove those arguments altogether! (if you want to act on an existing recording stream, just use one of its method)

I'm strongly advocating for the latter option.

cc @nikolausWest @jleibs

Copy link
Member

Choose a reason for hiding this comment

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

This is relevant: #9187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat-dataframe-api Everything related to the dataframe API include in changelog 🪵 Log & send APIs Affects the user-facing API for all languages 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RecordingStream should be able to forward an existing RRD file
4 participants