-
Notifications
You must be signed in to change notification settings - Fork 373
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
Create Rust version of the "Loggable Data Types" doc section #2501
Conversation
These examples were exceedingly interesting to write, and are IMHO very useful to identify the shortcomings of the current Rust API. In particular, I ran into the following gotcha, many of which required @teh-cmc's help to sort out:
|
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 awesome, cannot wait to make them less painful 😄
Co-authored-by: Clement Rey <cr.rey.clement@gmail.com>
Co-authored-by: Clement Rey <cr.rey.clement@gmail.com>
Co-authored-by: Clement Rey <cr.rey.clement@gmail.com>
Co-authored-by: Clement Rey <cr.rey.clement@gmail.com>
(Probably easier to review commit by commit) Follow up to my discussion with @abey79 regarding his poor experience with time tracking, which was summarized in #2501 (comment): > - When implementing the `step` timeline of the scalar example, I first searched for `set_time_sequence` (used in Python API) in the Rust docs, which I found in `RecordingStream`. Turns out it's not in 0.7 and bugged on `main` (or rather ignored by `MsgSender`). Again, it compiled and displayed no error, but no timeline was created. This PR makes it so that `RecordingStream` is always in charge of injecting its internal clock into outgoing rows (unless the caller ask it not to, e.g. because the data is meant to be timeless). This is pretty similar to what was already in place for `log_tick`, except it now applies to every timelines, whether they are builtin or user defined. - Within the Python SDK, this gets rid of all the existing manual time injection stuff. - On the Rust SDK's side, this fixes the issue that `MsgSender` used to ignore the internal clock altogether (i.e. the stateful time APIs were not supported at all for Rust users). - And finally this cleans up the Rust examples a bunch since we now have access to stateful time. --- <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2506 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/178edf5/docs Examples preview: https://rerun.io/preview/178edf5/examples <!-- pr-link-docs:end -->
(Probably easier to review commit by commit) Follow up to my discussion with @abey79 regarding his poor experience with time tracking, which was summarized in #2501 (comment): > - When implementing the `step` timeline of the scalar example, I first searched for `set_time_sequence` (used in Python API) in the Rust docs, which I found in `RecordingStream`. Turns out it's not in 0.7 and bugged on `main` (or rather ignored by `MsgSender`). Again, it compiled and displayed no error, but no timeline was created. This PR makes it so that `RecordingStream` is always in charge of injecting its internal clock into outgoing rows (unless the caller ask it not to, e.g. because the data is meant to be timeless). This is pretty similar to what was already in place for `log_tick`, except it now applies to every timelines, whether they are builtin or user defined. - Within the Python SDK, this gets rid of all the existing manual time injection stuff. - On the Rust SDK's side, this fixes the issue that `MsgSender` used to ignore the internal clock altogether (i.e. the stateful time APIs were not supported at all for Rust users). - And finally this cleans up the Rust examples a bunch since we now have access to stateful time. --- <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2506 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/178edf5/docs Examples preview: https://rerun.io/preview/178edf5/examples <!-- pr-link-docs:end -->
### What This PR introduces Rust versions of the "Loggable Data Types" documentation section. Choices I made along the way: - The primary aim was to stick as much as possible to the Python versions. The output should be the same. - I've used `ndarray` for all example (as opposed to, e.g., `ImageBuffer` for image-related examples). - I skipped translating `image_advanced.py` as it primarily focuses various Python packages (Pillow, OpenCV). ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [ ] I've included a screenshot or gif (if applicable) <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2501 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/72885f5/docs Examples preview: https://rerun.io/preview/72885f5/examples <!-- pr-link-docs:end --> --------- Co-authored-by: Clement Rey <cr.rey.clement@gmail.com>
What
This PR introduces Rust versions of the "Loggable Data Types" documentation section.
Choices I made along the way:
ndarray
for all example (as opposed to, e.g.,ImageBuffer
for image-related examples).image_advanced.py
as it primarily focuses various Python packages (Pillow, OpenCV).Checklist
PR Build Summary: https://build.rerun.io/pr/2501
Docs preview: https://rerun.io/preview/72885f5/docs
Examples preview: https://rerun.io/preview/72885f5/examples