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

Tagged columnar updates: Rust #8753

Closed
teh-cmc opened this issue Jan 21, 2025 · 0 comments · Fixed by #8764
Closed

Tagged columnar updates: Rust #8753

teh-cmc opened this issue Jan 21, 2025 · 0 comments · Fixed by #8764
Assignees
Labels
🔩 data model Sorbet 🦀 Rust API Rust logging API

Comments

@teh-cmc
Copy link
Member

teh-cmc commented Jan 21, 2025

Image

@teh-cmc teh-cmc added 🔩 data model Sorbet 🦀 Rust API Rust logging API labels Jan 21, 2025
@teh-cmc teh-cmc self-assigned this Jan 21, 2025
teh-cmc added a commit that referenced this issue Jan 22, 2025
* Generate plural methods even for mono-components, so they can be used
with `send_columns`.
* Update `scalar_send_columns` snippet to use new columnar APIs.

```rust
const STEPS: i64 = 64;

let times = TimeColumn::new_sequence("step", 0..STEPS);
let scalars = (0..STEPS).map(|step| (step as f64 / 10.0).sin());

rec.send_columns_v2(
    "scalars",
    [times],
    rerun::Scalar::update_fields()
        .with_many_scalar(scalars)
        .columns(std::iter::repeat(1).take(STEPS as _))?
        .filter(|column| !column.descriptor.component_name.contains("Indicator")),
)?;
```

* Follow-up to #8753
teh-cmc added a commit that referenced this issue Jan 22, 2025
teh-cmc added a commit that referenced this issue Jan 23, 2025
This makes the API far easier to use in the very common case where the
caller wants to split all of their data in unit-length batches.
I think it's worth the extra generated code.

Notes:
* The naming sucks.
* I disabled columnar APIs entirely for all blueprint stuff. I don't see
any reason to have all this code?

```diff
let times = TimeColumn::new_sequence("step", 0..STEPS);
let scalars = (0..STEPS).map(|step| (step as f64 / 10.0).sin());

rec.send_columns_v2(
    "scalars",
    [times],
    rerun::Scalar::update_fields()
        .with_many_scalar(scalars)
-        .columns(std::iter::repeat(1).take(STEPS as _))?,
+        .unary_columns()?,
)?;
```

* Follow-up to #8753
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔩 data model Sorbet 🦀 Rust API Rust logging API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant