Skip to content

Commit 75e311c

Browse files
authored
Merge branch 'main' into antoine/snippet-mypy
2 parents 3c6a0a6 + 6e80626 commit 75e311c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1342
-1115
lines changed

.github/workflows/contrib_checks.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ jobs:
123123
- name: Setup software rasterizer
124124
run: pixi run python ./scripts/ci/setup_software_rasterizer.py
125125

126+
# Recommended way to install nextest on CI.
127+
- name: Install latest nextest release
128+
uses: taiki-e/[email protected]
129+
with:
130+
131+
126132
- name: Rust checks & tests
127133
run: pixi run rs-check --skip individual_crates docs_slow
128134

Cargo.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3742,10 +3742,12 @@ checksum = "5c163c633eb184a4ad2a5e7a5dacf12a58c830d717a7963563d4eceb4ced079f"
37423742
dependencies = [
37433743
"jiff-static",
37443744
"jiff-tzdb-platform",
3745+
"js-sys",
37453746
"log",
37463747
"portable-atomic",
37473748
"portable-atomic-util",
37483749
"serde",
3750+
"wasm-bindgen",
37493751
"windows-sys 0.59.0",
37503752
]
37513753

@@ -5777,6 +5779,7 @@ name = "re_arrow_util"
57775779
version = "0.23.0-alpha.1+dev"
57785780
dependencies = [
57795781
"arrow",
5782+
"insta",
57805783
"itertools 0.13.0",
57815784
"re_log",
57825785
"re_tracing",
@@ -6173,7 +6176,6 @@ dependencies = [
61736176
"re_query",
61746177
"re_smart_channel",
61756178
"re_tracing",
6176-
"re_types",
61776179
"re_types_core",
61786180
"serde",
61796181
"similar-asserts",

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ indicatif = "0.17.7" # Progress bar
212212
infer = "0.16" # infer MIME type by checking the magic number signaturefer MIME type by checking the magic number signature
213213
insta = "1.23"
214214
itertools = "0.13"
215-
jiff = "0.2.3"
215+
jiff = { version = "0.2.3", features = ["js"] }
216216
js-sys = "0.3"
217217
jsonwebtoken = { version = "9", default-features = false }
218218
libc = "0.2"

crates/build/re_types_builder/src/codegen/python/mod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,8 +2654,15 @@ fn quote_columnar_methods(reporter: &Reporter, obj: &Object, objects: &Objects)
26542654
param = kwargs[batch.component_descriptor().archetype_field_name] # type: ignore[index]
26552655
shape = np.shape(param) # type: ignore[arg-type]
26562656
2657-
batch_length = shape[1] if len(shape) > 1 else 1 # type: ignore[redundant-expr,misc]
2658-
num_rows = shape[0] if len(shape) >= 1 else 1 # type: ignore[redundant-expr,misc]
2657+
if pa.types.is_fixed_size_list(arrow_array.type) and len(shape) <= 2:
2658+
# If shape length is 2 or less, we have `num_rows` single element batches (each element is a fixed sized list).
2659+
# `shape[1]` should be the length of the fixed sized list.
2660+
# (This should have been already validated by conversion to the arrow_array)
2661+
batch_length = 1
2662+
else:
2663+
batch_length = shape[1] if len(shape) > 1 else 1 # type: ignore[redundant-expr,misc]
2664+
2665+
num_rows = shape[0] if len(shape) >= 1 else 1 # type: ignore[redundant-expr,misc]
26592666
sizes = batch_length * np.ones(num_rows)
26602667
else:
26612668
# For non-primitive types, default to partitioning each element separately.

crates/store/re_data_loader/src/lerobot.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub enum LeRobotError {
143143
///
144144
/// Each episode is identified by a unique index and mapped to its corresponding chunk, based on the number of episodes
145145
/// per chunk (which can be found in `meta/info.json`).
146-
#[derive(Debug)]
146+
#[derive(Debug, Clone)]
147147
pub struct LeRobotDataset {
148148
pub path: PathBuf,
149149
pub metadata: LeRobotDatasetMetadata,
@@ -216,7 +216,7 @@ impl LeRobotDataset {
216216
///
217217
/// This is a wrapper struct for the metadata files in the `meta` directory of a
218218
/// `LeRobot` dataset. For more see [`LeRobotDataset`].
219-
#[derive(Debug)]
219+
#[derive(Debug, Clone)]
220220
#[allow(dead_code)] // TODO(gijsd): The list of tasks is not used yet!
221221
pub struct LeRobotDatasetMetadata {
222222
pub info: LeRobotDatasetInfo,
@@ -251,7 +251,7 @@ impl LeRobotDatasetMetadata {
251251
///
252252
/// This struct contains the metadata for a `LeRobot` dataset, and is loaded from the `meta/info.json` file
253253
/// of the dataset.
254-
#[derive(Serialize, Deserialize, Debug)]
254+
#[derive(Serialize, Deserialize, Debug, Clone)]
255255
pub struct LeRobotDatasetInfo {
256256
/// The type of the robot.
257257
pub robot_type: String,
@@ -381,7 +381,7 @@ impl LeRobotDatasetInfo {
381381
///
382382
/// For example, a shape of `[3, 224, 224]` for a [`DType::Image`] feature denotes a 3-channel (e.g. RGB)
383383
/// image with a height and width of 224 pixels each.
384-
#[derive(Serialize, Deserialize, Debug)]
384+
#[derive(Serialize, Deserialize, Debug, Clone)]
385385
pub struct Feature {
386386
pub dtype: DType,
387387
pub shape: Vec<usize>,
@@ -407,7 +407,7 @@ pub enum DType {
407407
/// - A flat list of names for each dimension of a feature (e.g., `["height", "width", "channel"]`).
408408
/// - A nested list of names for each dimension of a feature (e.g., `[[""kLeftShoulderPitch", "kLeftShoulderRoll"]]`)
409409
/// - A list specific to motors (e.g., `{ "motors": ["motor_0", "motor_1", ...] }`).
410-
#[derive(Debug, Serialize, Deserialize)]
410+
#[derive(Debug, Serialize, Deserialize, Clone)]
411411
#[serde(untagged)]
412412
pub enum Names {
413413
Motors { motors: Vec<String> },
@@ -426,7 +426,7 @@ impl Names {
426426

427427
/// A wrapper struct that deserializes flat or nested lists of strings
428428
/// into a single flattened [`Vec`] of names for easy indexing.
429-
#[derive(Debug, Serialize)]
429+
#[derive(Debug, Serialize, Clone)]
430430
pub struct NamesList(Vec<String>);
431431

432432
impl<'de> Deserialize<'de> for NamesList {
@@ -482,7 +482,7 @@ pub struct EpisodeIndex(pub usize);
482482
/// An episode in a `LeRobot` dataset.
483483
///
484484
/// Each episode contains its index, a list of associated tasks, and its total length in frames.
485-
#[derive(Debug, Serialize, Deserialize)]
485+
#[derive(Clone, Debug, Serialize, Deserialize)]
486486
pub struct LeRobotDatasetEpisode {
487487
#[serde(rename = "episode_index")]
488488
pub index: EpisodeIndex,
@@ -498,7 +498,7 @@ pub struct TaskIndex(pub usize);
498498
/// A task in a `LeRobot` dataset.
499499
///
500500
/// Each task consists of its index and a task description.
501-
#[derive(Debug, Serialize, Deserialize)]
501+
#[derive(Debug, Serialize, Deserialize, Clone)]
502502
pub struct LeRobotDatasetTask {
503503
#[serde(rename = "task_index")]
504504
pub index: TaskIndex,

crates/store/re_entity_db/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ web-time.workspace = true
5353

5454
[dev-dependencies]
5555
re_log_encoding = { workspace = true, features = ["decoder", "encoder"] }
56-
re_types.workspace = true
5756

5857
anyhow.workspace = true
5958
criterion.workspace = true

crates/store/re_entity_db/tests/clear.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ use re_log_types::{
1010
example_components::{MyColor, MyIndex, MyPoint},
1111
EntityPath, StoreId, TimeInt, TimePoint, Timeline,
1212
};
13-
use re_types::ComponentBatch as _;
14-
use re_types_core::{archetypes::Clear, components::ClearIsRecursive, AsComponents as _};
13+
use re_types_core::{
14+
archetypes::Clear, components::ClearIsRecursive, AsComponents as _, ComponentBatch as _,
15+
};
1516

1617
// ---
1718

crates/store/re_protos/proto/rerun/v1alpha1/remote_store.proto

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ service StorageNodeService {
5757

5858
// Registration APIs
5959

60-
// TODO(zehiko) support registering more than one recording at a time
61-
rpc RegisterRecording(RegisterRecordingRequest) returns (RegisterRecordingResponse) {}
60+
rpc RegisterRecordings(RegisterRecordingsRequest) returns (RegisterRecordingsResponse) {}
6261

62+
// TODO(cmc): This needs to be batched. Everything needs to be batched, always.
6363
rpc UnregisterRecording(UnregisterRecordingRequest) returns (UnregisterRecordingResponse) {}
6464

6565
rpc UnregisterAllRecordings(UnregisterAllRecordingsRequest) returns (UnregisterAllRecordingsResponse) {}
@@ -425,21 +425,29 @@ message GetRecordingSchemaResponse {
425425

426426
// ---------------- RegisterRecording ------------------
427427

428-
message RegisterRecordingRequest {
428+
message RegisterRecordingsRequest {
429429
// to which catalog entry do we want to register the recording
430430
CatalogEntry entry = 1;
431+
432+
repeated RegisterRecordingDescription recordings = 2;
433+
}
434+
435+
message RegisterRecordingDescription {
431436
// human readable description of the recording
432-
string description = 2;
437+
string description = 1;
438+
433439
// recording storage url (e.g. s3://bucket/file or file:///path/to/file)
434-
string storage_url = 3;
440+
string storage_url = 2;
441+
435442
// type of recording
436-
RecordingType typ = 4;
443+
RecordingType typ = 3;
444+
437445
// (optional) any additional metadata that should be associated with the recording
438446
// You can associate any arbtrirary number of columns with a specific recording
439-
DataframePart metadata = 5;
447+
DataframePart metadata = 4;
440448
}
441449

442-
message RegisterRecordingResponse {
450+
message RegisterRecordingsResponse {
443451
DataframePart data = 1;
444452
}
445453

crates/store/re_protos/src/v1alpha1/rerun.remote_store.v1alpha1.rs

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -824,47 +824,62 @@ impl ::prost::Name for GetRecordingSchemaResponse {
824824
}
825825
}
826826
#[derive(Clone, PartialEq, ::prost::Message)]
827-
pub struct RegisterRecordingRequest {
827+
pub struct RegisterRecordingsRequest {
828828
/// to which catalog entry do we want to register the recording
829829
#[prost(message, optional, tag = "1")]
830830
pub entry: ::core::option::Option<CatalogEntry>,
831+
#[prost(message, repeated, tag = "2")]
832+
pub recordings: ::prost::alloc::vec::Vec<RegisterRecordingDescription>,
833+
}
834+
impl ::prost::Name for RegisterRecordingsRequest {
835+
const NAME: &'static str = "RegisterRecordingsRequest";
836+
const PACKAGE: &'static str = "rerun.remote_store.v1alpha1";
837+
fn full_name() -> ::prost::alloc::string::String {
838+
"rerun.remote_store.v1alpha1.RegisterRecordingsRequest".into()
839+
}
840+
fn type_url() -> ::prost::alloc::string::String {
841+
"/rerun.remote_store.v1alpha1.RegisterRecordingsRequest".into()
842+
}
843+
}
844+
#[derive(Clone, PartialEq, ::prost::Message)]
845+
pub struct RegisterRecordingDescription {
831846
/// human readable description of the recording
832-
#[prost(string, tag = "2")]
847+
#[prost(string, tag = "1")]
833848
pub description: ::prost::alloc::string::String,
834849
/// recording storage url (e.g. s3://bucket/file or file:///path/to/file)
835-
#[prost(string, tag = "3")]
850+
#[prost(string, tag = "2")]
836851
pub storage_url: ::prost::alloc::string::String,
837852
/// type of recording
838-
#[prost(enumeration = "RecordingType", tag = "4")]
853+
#[prost(enumeration = "RecordingType", tag = "3")]
839854
pub typ: i32,
840855
/// (optional) any additional metadata that should be associated with the recording
841856
/// You can associate any arbtrirary number of columns with a specific recording
842-
#[prost(message, optional, tag = "5")]
857+
#[prost(message, optional, tag = "4")]
843858
pub metadata: ::core::option::Option<DataframePart>,
844859
}
845-
impl ::prost::Name for RegisterRecordingRequest {
846-
const NAME: &'static str = "RegisterRecordingRequest";
860+
impl ::prost::Name for RegisterRecordingDescription {
861+
const NAME: &'static str = "RegisterRecordingDescription";
847862
const PACKAGE: &'static str = "rerun.remote_store.v1alpha1";
848863
fn full_name() -> ::prost::alloc::string::String {
849-
"rerun.remote_store.v1alpha1.RegisterRecordingRequest".into()
864+
"rerun.remote_store.v1alpha1.RegisterRecordingDescription".into()
850865
}
851866
fn type_url() -> ::prost::alloc::string::String {
852-
"/rerun.remote_store.v1alpha1.RegisterRecordingRequest".into()
867+
"/rerun.remote_store.v1alpha1.RegisterRecordingDescription".into()
853868
}
854869
}
855870
#[derive(Clone, PartialEq, ::prost::Message)]
856-
pub struct RegisterRecordingResponse {
871+
pub struct RegisterRecordingsResponse {
857872
#[prost(message, optional, tag = "1")]
858873
pub data: ::core::option::Option<DataframePart>,
859874
}
860-
impl ::prost::Name for RegisterRecordingResponse {
861-
const NAME: &'static str = "RegisterRecordingResponse";
875+
impl ::prost::Name for RegisterRecordingsResponse {
876+
const NAME: &'static str = "RegisterRecordingsResponse";
862877
const PACKAGE: &'static str = "rerun.remote_store.v1alpha1";
863878
fn full_name() -> ::prost::alloc::string::String {
864-
"rerun.remote_store.v1alpha1.RegisterRecordingResponse".into()
879+
"rerun.remote_store.v1alpha1.RegisterRecordingsResponse".into()
865880
}
866881
fn type_url() -> ::prost::alloc::string::String {
867-
"/rerun.remote_store.v1alpha1.RegisterRecordingResponse".into()
882+
"/rerun.remote_store.v1alpha1.RegisterRecordingsResponse".into()
868883
}
869884
}
870885
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -1608,26 +1623,26 @@ pub mod storage_node_service_client {
16081623
));
16091624
self.inner.unary(req, path, codec).await
16101625
}
1611-
/// TODO(zehiko) support registering more than one recording at a time
1612-
pub async fn register_recording(
1626+
pub async fn register_recordings(
16131627
&mut self,
1614-
request: impl tonic::IntoRequest<super::RegisterRecordingRequest>,
1615-
) -> std::result::Result<tonic::Response<super::RegisterRecordingResponse>, tonic::Status>
1628+
request: impl tonic::IntoRequest<super::RegisterRecordingsRequest>,
1629+
) -> std::result::Result<tonic::Response<super::RegisterRecordingsResponse>, tonic::Status>
16161630
{
16171631
self.inner.ready().await.map_err(|e| {
16181632
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
16191633
})?;
16201634
let codec = tonic::codec::ProstCodec::default();
16211635
let path = http::uri::PathAndQuery::from_static(
1622-
"/rerun.remote_store.v1alpha1.StorageNodeService/RegisterRecording",
1636+
"/rerun.remote_store.v1alpha1.StorageNodeService/RegisterRecordings",
16231637
);
16241638
let mut req = request.into_request();
16251639
req.extensions_mut().insert(GrpcMethod::new(
16261640
"rerun.remote_store.v1alpha1.StorageNodeService",
1627-
"RegisterRecording",
1641+
"RegisterRecordings",
16281642
));
16291643
self.inner.unary(req, path, codec).await
16301644
}
1645+
/// TODO(cmc): This needs to be batched. Everything needs to be batched, always.
16311646
pub async fn unregister_recording(
16321647
&mut self,
16331648
request: impl tonic::IntoRequest<super::UnregisterRecordingRequest>,
@@ -1791,11 +1806,11 @@ pub mod storage_node_service_server {
17911806
&self,
17921807
request: tonic::Request<super::GetRecordingSchemaRequest>,
17931808
) -> std::result::Result<tonic::Response<super::GetRecordingSchemaResponse>, tonic::Status>;
1794-
/// TODO(zehiko) support registering more than one recording at a time
1795-
async fn register_recording(
1809+
async fn register_recordings(
17961810
&self,
1797-
request: tonic::Request<super::RegisterRecordingRequest>,
1798-
) -> std::result::Result<tonic::Response<super::RegisterRecordingResponse>, tonic::Status>;
1811+
request: tonic::Request<super::RegisterRecordingsRequest>,
1812+
) -> std::result::Result<tonic::Response<super::RegisterRecordingsResponse>, tonic::Status>;
1813+
/// TODO(cmc): This needs to be batched. Everything needs to be batched, always.
17991814
async fn unregister_recording(
18001815
&self,
18011816
request: tonic::Request<super::UnregisterRecordingRequest>,
@@ -2524,22 +2539,23 @@ pub mod storage_node_service_server {
25242539
};
25252540
Box::pin(fut)
25262541
}
2527-
"/rerun.remote_store.v1alpha1.StorageNodeService/RegisterRecording" => {
2542+
"/rerun.remote_store.v1alpha1.StorageNodeService/RegisterRecordings" => {
25282543
#[allow(non_camel_case_types)]
2529-
struct RegisterRecordingSvc<T: StorageNodeService>(pub Arc<T>);
2544+
struct RegisterRecordingsSvc<T: StorageNodeService>(pub Arc<T>);
25302545
impl<T: StorageNodeService>
2531-
tonic::server::UnaryService<super::RegisterRecordingRequest>
2532-
for RegisterRecordingSvc<T>
2546+
tonic::server::UnaryService<super::RegisterRecordingsRequest>
2547+
for RegisterRecordingsSvc<T>
25332548
{
2534-
type Response = super::RegisterRecordingResponse;
2549+
type Response = super::RegisterRecordingsResponse;
25352550
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
25362551
fn call(
25372552
&mut self,
2538-
request: tonic::Request<super::RegisterRecordingRequest>,
2553+
request: tonic::Request<super::RegisterRecordingsRequest>,
25392554
) -> Self::Future {
25402555
let inner = Arc::clone(&self.0);
25412556
let fut = async move {
2542-
<T as StorageNodeService>::register_recording(&inner, request).await
2557+
<T as StorageNodeService>::register_recordings(&inner, request)
2558+
.await
25432559
};
25442560
Box::pin(fut)
25452561
}
@@ -2550,7 +2566,7 @@ pub mod storage_node_service_server {
25502566
let max_encoding_message_size = self.max_encoding_message_size;
25512567
let inner = self.inner.clone();
25522568
let fut = async move {
2553-
let method = RegisterRecordingSvc(inner);
2569+
let method = RegisterRecordingsSvc(inner);
25542570
let codec = tonic::codec::ProstCodec::default();
25552571
let mut grpc = tonic::server::Grpc::new(codec)
25562572
.apply_compression_config(

crates/top/rerun/src/commands/entrypoint.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -809,14 +809,12 @@ fn run_impl(
809809
anyhow::bail!("`--serve` does not support catalogs");
810810
}
811811

812-
#[cfg(not(feature = "server"))]
813-
{
812+
if !cfg!(feature = "server") {
814813
_ = (call_source, rxs);
815814
anyhow::bail!("Can't host server - rerun was not compiled with the 'server' feature");
816815
}
817816

818-
#[cfg(not(feature = "web_viewer"))]
819-
if args.web_viewer {
817+
if !cfg!(feature = "web_viewer") {
820818
anyhow::bail!(
821819
"Can't host web-viewer - rerun was not compiled with the 'web_viewer' feature"
822820
);

crates/utils/re_arrow_util/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ re_tracing.workspace = true
2828

2929
arrow.workspace = true
3030
itertools.workspace = true
31+
32+
[dev-dependencies]
33+
insta.workspace = true

0 commit comments

Comments
 (0)