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

Vastly improved support for deserialized iteration #7024

Merged
merged 5 commits into from
Aug 2, 2024

Conversation

teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Jul 31, 2024

Whether we like it or not, sometimes we've got to deserialize.

Up until now, the new APIs only provided a nice UX for the deserialization-free paths, while the deserialized path was particularly painful to use.

The source of the pain is, as so often, the lack of lending iterators in the stdlib. This PR fixes that.

Essentially, this:

let all_fill_mode_chunks = results.get_optional_chunks(&FillMode::name());
let all_fill_modes = results.iter_as(timeline, FillMode::name());
let mut all_fill_mode_iters = all_fill_mode_chunks
    .iter()
    .map(|chunk| chunk.iter_component::<FillMode>())
    .collect_vec();
let mut all_fill_modes_indexed = {
    let all_fill_modes =
        all_fill_mode_iters.iter_mut().flat_map(|it| it.into_iter());
    let all_fill_modes_indices = all_fill_mode_chunks.iter().flat_map(|chunk| {
        chunk.iter_component_indices(&timeline, &FillMode::name())
    });
    itertools::izip!(all_fill_modes_indices, all_fill_modes)
};

becomes this:

let all_fill_modes = results.iter_as(timeline, FillMode::name()).component::<FillMode>();

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@teh-cmc teh-cmc added 🧑‍💻 dev experience developer experience (excluding CI) 🔍 re_query affects re_query itself do-not-merge Do not merge this PR 🍏 primitives Relating to Rerun primitives include in changelog labels Jul 31, 2024
@teh-cmc teh-cmc mentioned this pull request Jul 31, 2024
6 tasks
@Wumpf Wumpf self-requested a review August 1, 2024 09:58
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.

ah nasty indeed how an arc is needed here. Kinda magic how that solves the chunk iterators

@teh-cmc teh-cmc force-pushed the cmc/chunkified_queries_14_remaining_shapes branch from 13bcc8d to bf6a7d9 Compare August 2, 2024 08:55
Base automatically changed from cmc/chunkified_queries_14_remaining_shapes to main August 2, 2024 08:56
@teh-cmc teh-cmc force-pushed the cmc/chunkified_queries_bonus_lending_iterators branch from d8c2048 to d50051a Compare August 2, 2024 09:08
@teh-cmc teh-cmc merged commit d9deef0 into main Aug 2, 2024
23 of 27 checks passed
@teh-cmc teh-cmc deleted the cmc/chunkified_queries_bonus_lending_iterators branch August 2, 2024 09:08
teh-cmc added a commit that referenced this pull request Aug 2, 2024
Chunkified visualizers for all image types.

First signs of old APIs going away.
In particular, `re_space_view_spatial` has dropped its dependency on the
old `re_query`.

- DNM: requires #7024

---

#### Image

![image](https://github.com/user-attachments/assets/548f2c9c-9843-470c-9ab6-611f7e677024)

#### ImageEncoded

![image](https://github.com/user-attachments/assets/0ae124bc-ef98-4d9c-91ac-077f62990a8c)

#### DepthImage

![image](https://github.com/user-attachments/assets/9a8b67b3-b85b-479b-b35f-0f43e2f10d58)

#### SegmentationImage

![image](https://github.com/user-attachments/assets/a32d4aff-d66e-4102-bdc8-ae77de641ab3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍💻 dev experience developer experience (excluding CI) do-not-merge Do not merge this PR include in changelog 🍏 primitives Relating to Rerun primitives 🔍 re_query affects re_query itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants