-
Notifications
You must be signed in to change notification settings - Fork 408
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
oxkitsune
wants to merge
10
commits into
main
Choose a base branch
from
gijs/to-stream
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+132
−4
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9dfd6a2
send_recording api
oxkitsune 0eedad7
fmt
oxkitsune a0d725f
fix ci
oxkitsune 7c8b21a
feedback
oxkitsune 8f1afb3
add send_recording snippet
oxkitsune 7fa4dab
load rrd in snippet
oxkitsune 399d3e7
update example asset
oxkitsune 776d0cf
use dna rrd
oxkitsune ffa7c43
document copied store info
oxkitsune e2c8996
Add rust send_recording snippet
oxkitsune File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""Send a dataframe to a new recording stream.""" | ||
|
||
import sys | ||
|
||
import rerun as rr | ||
|
||
path_to_rrd = sys.argv[1] | ||
|
||
recording = rr.dataframe.load_recording(path_to_rrd) | ||
|
||
rr.init(recording.application_id(), recording_id=recording.recording_id(), spawn=True) | ||
rr.send_recording(recording) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//! Send a `.rrd` to a new recording stream. | ||
|
||
use rerun::external::re_chunk_store::{ChunkStore, ChunkStoreConfig}; | ||
use rerun::external::re_log_types::{LogMsg, SetStoreInfo}; | ||
use rerun::external::re_tuid::Tuid; | ||
use rerun::VersionPolicy; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
// Get the filename from the command-line args. | ||
let filename = std::env::args().nth(2).ok_or("Missing filename argument")?; | ||
|
||
// Load the chunk store from the file. | ||
let (store_id, store) = | ||
ChunkStore::from_rrd_filepath(&ChunkStoreConfig::DEFAULT, filename, VersionPolicy::Warn)? | ||
.into_iter() | ||
.next() | ||
.ok_or("Expected exactly one recording in the archive")?; | ||
|
||
// Use the same app and recording IDs as the original. | ||
if let Some(info) = store.info().cloned() { | ||
let new_recording = rerun::RecordingStreamBuilder::new(info.application_id.clone()) | ||
.recording_id(store_id.to_string()) | ||
.spawn()?; | ||
|
||
new_recording.record_msg(LogMsg::SetStoreInfo(SetStoreInfo { | ||
row_id: Tuid::new(), | ||
info, | ||
})); | ||
|
||
// Forward all chunks to the new recording stream. | ||
new_recording.send_chunks(store.iter_chunks().map(|chunk| (**chunk).clone())); | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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:
recording: RecordingStream
arguments of the stateful API tostream: RecordingStream
,I'm strongly advocating for the latter option.
cc @nikolausWest @jleibs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is relevant: #9187
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm late to the party on this one, but we should really think about the flow between the
Recording
and aRecordingStream
object a bit more.For example: the
MemoryRecording
would ideally go away and just be aRecording
. Would be so nice to be able to log to the in-memory recording and then query it without needing to re-load it from an rrd.