diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d046c9cfedc2..f11e5db8cde3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -189,7 +189,7 @@ jobs: - [ ] cargo install of cli tool: does it install and run? - [ ] C++ SDK zip: does it contain rerun_c for all platforms? - [ ] Populate the release with the changelog and a nice header video/picture, check `Set as latest release`, then click `Publish release`. - - [ ] Update the [google colab notebooks](https://drive.google.com/drive/folders/0AC0q24MFKh3fUk9PVA) to install this version and re-execute the notebook. + - [ ] Update the [google colab notebooks](https://colab.research.google.com/drive/1R9I7s4o6wydQC_zkybqaSRFTtlEaked_) to install this version and re-execute the notebook. - [ ] Update landing's version of the web viewer (@jprochazk) A few hours after the GitHub release is created, `regro-cf-autotick-bot` will create a @@ -321,7 +321,7 @@ jobs: github-release: name: "GitHub Release" - if: inputs.release-type == 'final' + if: inputs.release-type == 'rc' || inputs.release-type == 'final' needs: [ version, @@ -347,9 +347,16 @@ jobs: run: | version="${{ needs.version.outputs.final }}" commit="${{ needs.version.outputs.release-commit }}" + + if [ ${{ inputs.release-type }} = "final" ]; then + pre_arg="" + else + pre_arg="--prerelease" + fi + git tag $version $commit git push origin $version - gh release create $version --verify-tag --draft --title $version + gh release create $version --verify-tag --draft --title $version $pre_arg - name: Create comment env: diff --git a/.gitignore b/.gitignore index 43b4208ba656..06d4384f6e35 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ __MACOSX *.bin *.o /arrow/ -/build/ +./build/ **/build-msvc/ **/CMakeFiles/ **/CMakeCache.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index a94fc73a0c0d..6f40cd8ec176 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,182 @@ ## [Unreleased](https://github.com/rerun-io/rerun/compare/latest...HEAD) +## [0.21.0](https://github.com/rerun-io/rerun/compare/0.20.3...0.21.0) - Graph view, 3D Grid & UI/UX improvements + +📖 Release blogpost: https://rerun.io/blog/graphs + +🧳 Migration guide: https://rerun.io/docs/reference/migration/migration-0-21 + +### ✨ Overview & highlights + +#### Graph view + +We've added two new logging primitives: [`GraphNodes`](https://rerun.io/docs/reference/types/archetypes/graph_nodes) and [`GraphEdges`](https://rerun.io/docs/reference/types/archetypes/graph_edges) that can be used to visualize node-link diagrams. For this, we have implemented a new Graph View that uses force-based layouts to draw graphs. + +This video demonstrates the main features of the new graph view: + +https://github.com/user-attachments/assets/77db75c9-a8d8-401d-b90d-3daf08baf0ba + +You can also have a look at https://github.com/rerun-io/rerun/pull/7500 if you want to learn to more. + +#### UX improvements + +This video demonstrates the main UX improvements that went into this release: + +https://github.com/user-attachments/assets/bef071b5-0681-41b2-9ef0-1c6a557ff138 + +#### 3D grid + +The 3D view now offers an infinite 3D grid, enabled by default. Further controls and settings are available as usual through the blueprint API and/or the selection panel. + +

+ + + +

+ +All the nitty gritty details in https://github.com/rerun-io/rerun/pull/8230 and https://github.com/rerun-io/rerun/pull/8234. + +#### Undo/Redo support & many more UI/UX improvements + +You can now undo/redo blueprint changes in the viewer! +Watch [@emilk](https://github.com/emilk/) putting it to action and explains how it works: + +https://github.com/user-attachments/assets/a29c099d-35a3-4d32-8946-932b5a184943 + + +#### Other UX improvements + +But that's not the only thing that improved in the viewer: +* Breadcrumbs show up in the selection menu now + + ![image](https://github.com/user-attachments/assets/c1d20eb1-f259-4b43-89d4-b9fdc75dc88c) + +* Take screenshots of views from context menus + + ![image](https://github.com/user-attachments/assets/6c50e6f0-330f-43f7-a393-65dd47aa171b) + +* Entities can now be dragged from Blueprint & Streams panel into views + + ![image](https://github.com/user-attachments/assets/493d9711-c4d1-407e-ab41-eef2e4e51ba8) + +#### Index of code snippets + +We now have a new [index for all our code snippets](./docs/snippets/INDEX.md). + +You can use it to quickly find copy-pastable snippets of code for any Rerun feature you're interested in (API, Archetypes, Components, etc). +No special tools required -- all you need is a keyword of interest, and plain old text search. + +It's still the early days so it is far from perfect, but we think it can already be quite helpful; feedback welcome. +Most of it is auto-generated, so it will never get out of sync! + +### ⚠️ Breaking changes + +* Near clip plane for `Spatial2D` views now defaults to `0.1` in 3D scene units. +* Blueprint: types and fields got renamed from `.*space_view.*`/`.*SpaceView.*` to `.*view.*`/`.*View.*`. +* 3D transform arrow visualization show up less often by default. +* `DisconnectedSpace` archetype/component is deprecated in favor of implicit invalid transforms (like zero scale or zero rotation matrix). +* `RotationAxisAngle` with zero rotation axis is no longer treated as identity. + +Read our 🧳 migration guide for more detailed information: https://rerun.io/docs/reference/migration/migration-0-21. + +### 🔎 Details + +#### 🪵 Log API +- End-to-end tagging: Rust [#8304](https://github.com/rerun-io/rerun/pull/8304) +- Encode `LogMsg` using protobuf [#8347](https://github.com/rerun-io/rerun/pull/8347) + +#### 🌊 C++ API +- End-to-end tagging: C++ [#8316](https://github.com/rerun-io/rerun/pull/8316) + +#### 🐍 Python API +- Never direct users towards using `rr.log_components` [#8151](https://github.com/rerun-io/rerun/pull/8151) +- Make it possible to log custom components using `rr.send_columns` [#8163](https://github.com/rerun-io/rerun/pull/8163) +- Lint and fix python SDK `(Py)RecordingStream` upcasting issues [#8184](https://github.com/rerun-io/rerun/pull/8184) +- End-to-end tagging: Python [#8298](https://github.com/rerun-io/rerun/pull/8298) +- Rename space view to view everywhere [#8396](https://github.com/rerun-io/rerun/pull/8396) +- Fix broken notebook loading on firefox by compressing the encoded wasm payload [#8426](https://github.com/rerun-io/rerun/pull/8426) +- Add utility to `rr.components.Color` to generate colors from any string (and use it in the air traffic data example) [#8458](https://github.com/rerun-io/rerun/pull/8458) +- Introduce new API to send a dataframe to Rerun [#8461](https://github.com/rerun-io/rerun/pull/8461) + +#### 🦀 Rust API +- Update MSRV to 1.80 [#8178](https://github.com/rerun-io/rerun/pull/8178) +- Remove `Loggable::NAME` -- Loggables do not have any semantics [#8082](https://github.com/rerun-io/rerun/pull/8082) +- Never direct users towards using `RecordingStream::log_component_batches` [#8149](https://github.com/rerun-io/rerun/pull/8149) +- Rust API: be explicit about when we're using the arrow2 crate [#8194](https://github.com/rerun-io/rerun/pull/8194) +- Add `from_gray16` for `DepthImage` [#8213](https://github.com/rerun-io/rerun/pull/8213) (thanks [@fawdlstty](https://github.com/fawdlstty)!) +- Rust: more `impl` helpers [#8401](https://github.com/rerun-io/rerun/pull/8401) + +#### 🪳 Bug fixes +- Fix outlines for lines having more perceived aliasing since 0.20 [#8317](https://github.com/rerun-io/rerun/pull/8317) +- Fix handling unnormalized axis for (Pose)RotationAxisAngle [#8341](https://github.com/rerun-io/rerun/pull/8341) +- Fix 2D/3D view artifacts on view's border when using fractional zoom [#8369](https://github.com/rerun-io/rerun/pull/8369) + +#### 🌁 Viewer improvements +- World grid part 1/2: add world grid renderer to `re_renderer` [#8230](https://github.com/rerun-io/rerun/pull/8230) +- World grid part 2/2: Integrate into Viewer [#8234](https://github.com/rerun-io/rerun/pull/8234) +- Add Undo/Redo support in the viewer [#7546](https://github.com/rerun-io/rerun/pull/7546) +- Space view screenshotting in native viewer [#8258](https://github.com/rerun-io/rerun/pull/8258) +- Remove selection history [#8296](https://github.com/rerun-io/rerun/pull/8296) +- Make the near clipping plane editable in 2D views [#8348](https://github.com/rerun-io/rerun/pull/8348) +- Don't show transform arrows on all entities without any other visualizer [#8387](https://github.com/rerun-io/rerun/pull/8387) +- Do query for default components only once per view [#8424](https://github.com/rerun-io/rerun/pull/8424) +- Improve hovered order in 2D views [#8405](https://github.com/rerun-io/rerun/pull/8405) +- Remove wait-time when opening settings panel [#8464](https://github.com/rerun-io/rerun/pull/8464) +- Deprecate `DisconnectedSpace` archetype/component in favor of implicit invalid transforms [#8459](https://github.com/rerun-io/rerun/pull/8459) +- Improve graphics device capability detection, warn on old devices, early error on unsupported render targets [#8476](https://github.com/rerun-io/rerun/pull/8476) + +#### 🧑‍🏫 Examples +- Add a new "Air Traffic Data" example [#5449](https://github.com/rerun-io/rerun/pull/5449) +- Use video logging api in `detect_and_track` example [#8261](https://github.com/rerun-io/rerun/pull/8261) (thanks [@oxkitsune](https://github.com/oxkitsune)!) +- Add hloc_glomap example and update manifest [#8352](https://github.com/rerun-io/rerun/pull/8352) (thanks [@pablovela5620](https://github.com/pablovela5620)!) +- Introduce the Snippet Index [#8383](https://github.com/rerun-io/rerun/pull/8383) +- Implement complete Graph View example [#8421](https://github.com/rerun-io/rerun/pull/8421) + +#### 📚 Docs +- Update wheel build instruction [#8235](https://github.com/rerun-io/rerun/pull/8235) +- Fix various doc links in SDKs [#8331](https://github.com/rerun-io/rerun/pull/8331) + +#### 🖼 UI improvements +- Implement graph components and archetypes [#7500](https://github.com/rerun-io/rerun/pull/7500) +- Add support for Bezier-curve multi (self-)edges [#8256](https://github.com/rerun-io/rerun/pull/8256) +- Implement incremental graph layouts [#8308](https://github.com/rerun-io/rerun/pull/8308) +- Revert label background color to that in 0.19 [#8337](https://github.com/rerun-io/rerun/pull/8337) +- Add selection hierarchy breadcrumbs [#8319](https://github.com/rerun-io/rerun/pull/8319) +- More compact selection panel when multiple items selected [#8351](https://github.com/rerun-io/rerun/pull/8351) +- Make Position2D components editable in selection panel [#8357](https://github.com/rerun-io/rerun/pull/8357) +- Dynamic configuration of graph layout forces through blueprints [#8299](https://github.com/rerun-io/rerun/pull/8299) +- Document legend interaction in the timeseries view help text [#8406](https://github.com/rerun-io/rerun/pull/8406) +- Allow drag-and-dropping multiple containers and views in the blueprint tree [#8334](https://github.com/rerun-io/rerun/pull/8334) +- Improve picking in 2D views [#8404](https://github.com/rerun-io/rerun/pull/8404) +- Make our collapsing triangle thinner for more consistency with our icons [#8408](https://github.com/rerun-io/rerun/pull/8408) +- Entities can be dragged from the blueprint tree and streams tree to an existing view in the viewport [#8431](https://github.com/rerun-io/rerun/pull/8431) + +#### 🎨 Renderer improvements +- Update egui to latest, update wgpu to 23.0.0 [#8183](https://github.com/rerun-io/rerun/pull/8183) + +#### ✨ Other enhancement +- Improve `rrd print`'s verbosity modes [#8392](https://github.com/rerun-io/rerun/pull/8392) +- Miscellaneous improvements to archetype reflection [#8432](https://github.com/rerun-io/rerun/pull/8432) +- Migration kernel for the blueprint space-view-related breaking changes [#8439](https://github.com/rerun-io/rerun/pull/8439) + +#### 🗣 Refactors +- Add arrow(1)-interface on top of `Loggable` and `ArrowBuffer` [#8197](https://github.com/rerun-io/rerun/pull/8197) +- `re_types_blueprint` -> `re_types::blueprint` [#8419](https://github.com/rerun-io/rerun/pull/8419) +- `re_viewer::reflection` -> `re_types::reflection` [#8420](https://github.com/rerun-io/rerun/pull/8420) + +#### 📦 Dependencies +- Numpy 2.0 allowed in pyproject.toml [#8306](https://github.com/rerun-io/rerun/pull/8306) (thanks [@Ipuch](https://github.com/Ipuch)!) +- Upgrade to egui 0.30 (+ ecosystem) [#8516](https://github.com/rerun-io/rerun/pull/8516) + +#### 🧑‍💻 Dev-experience +- Add `MainThreadToken` to ensure file-dialogs only run on the main thread [#8467](https://github.com/rerun-io/rerun/pull/8467) + +#### 🤷‍ Other +- Deprecate `--serve`, add `--serve-web` [#8144](https://github.com/rerun-io/rerun/pull/8144) +- Clean up pass over all superfluous hashing happening on the query path [#8207](https://github.com/rerun-io/rerun/pull/8207) +- Improve performance of time panel [#8224](https://github.com/rerun-io/rerun/pull/8224) + ## [0.20.3](https://github.com/rerun-io/rerun/compare/0.20.2...0.20.3) - Web viewer fix ### 🔎 Details diff --git a/Cargo.lock b/Cargo.lock index 60076725fe56..12ac9a4c6699 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1381,7 +1381,7 @@ dependencies = [ [[package]] name = "clock" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -1724,7 +1724,7 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "custom_data_loader" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "re_build_tools", "rerun", @@ -1732,7 +1732,7 @@ dependencies = [ [[package]] name = "custom_store_subscriber" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "re_build_tools", "rerun", @@ -1740,7 +1740,7 @@ dependencies = [ [[package]] name = "custom_view" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "mimalloc", "re_crash_handler", @@ -1796,7 +1796,7 @@ checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" [[package]] name = "dataframe_query" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "itertools 0.13.0", "rerun", @@ -1891,7 +1891,7 @@ dependencies = [ [[package]] name = "dna" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "itertools 0.13.0", "rand", @@ -2395,7 +2395,7 @@ dependencies = [ [[package]] name = "extend_viewer_ui" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "mimalloc", "re_crash_handler", @@ -2928,7 +2928,7 @@ dependencies = [ [[package]] name = "graph_lattice" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -3520,7 +3520,7 @@ dependencies = [ [[package]] name = "incremental_logging" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -3951,7 +3951,7 @@ dependencies = [ [[package]] name = "log_benchmark" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -3962,7 +3962,7 @@ dependencies = [ [[package]] name = "log_file" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -4140,14 +4140,14 @@ dependencies = [ [[package]] name = "minimal" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "rerun", ] [[package]] name = "minimal_options" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -4157,7 +4157,7 @@ dependencies = [ [[package]] name = "minimal_serve" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "rerun", ] @@ -4758,7 +4758,7 @@ dependencies = [ [[package]] name = "objectron" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -4984,7 +4984,7 @@ dependencies = [ [[package]] name = "plot_dashboard_stress" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -5477,7 +5477,7 @@ checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "raw_mesh" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "bytes", @@ -5520,7 +5520,7 @@ checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" [[package]] name = "re_analytics" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "crossbeam", "directories", @@ -5568,7 +5568,7 @@ dependencies = [ [[package]] name = "re_blueprint_tree" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "egui", "itertools 0.13.0", @@ -5587,14 +5587,14 @@ dependencies = [ [[package]] name = "re_build_info" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "serde", ] [[package]] name = "re_build_tools" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "cargo_metadata 0.18.1", @@ -5607,7 +5607,7 @@ dependencies = [ [[package]] name = "re_capabilities" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "document-features", "egui", @@ -5616,14 +5616,14 @@ dependencies = [ [[package]] name = "re_case" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "convert_case", ] [[package]] name = "re_chunk" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -5652,7 +5652,7 @@ dependencies = [ [[package]] name = "re_chunk_store" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -5684,7 +5684,7 @@ dependencies = [ [[package]] name = "re_chunk_store_ui" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "egui", "egui_extras", @@ -5699,7 +5699,7 @@ dependencies = [ [[package]] name = "re_component_ui" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "egui", "egui_extras", @@ -5718,7 +5718,7 @@ dependencies = [ [[package]] name = "re_context_menu" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "egui", "egui_tiles", @@ -5739,7 +5739,7 @@ dependencies = [ [[package]] name = "re_crash_handler" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "backtrace", "econtext", @@ -5752,7 +5752,7 @@ dependencies = [ [[package]] name = "re_data_loader" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -5781,7 +5781,7 @@ dependencies = [ [[package]] name = "re_data_source" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "itertools 0.13.0", @@ -5799,7 +5799,7 @@ dependencies = [ [[package]] name = "re_data_ui" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -5829,7 +5829,7 @@ dependencies = [ [[package]] name = "re_dataframe" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "itertools 0.13.0", @@ -5853,7 +5853,7 @@ dependencies = [ [[package]] name = "re_dev_tools" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "argh", @@ -5880,7 +5880,7 @@ dependencies = [ [[package]] name = "re_entity_db" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -5913,21 +5913,21 @@ dependencies = [ [[package]] name = "re_error" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", ] [[package]] name = "re_format" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "num-traits", ] [[package]] name = "re_format_arrow" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "comfy-table", "re_arrow2", @@ -5937,7 +5937,7 @@ dependencies = [ [[package]] name = "re_grpc_client" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "re_chunk", "re_error", @@ -5958,7 +5958,7 @@ dependencies = [ [[package]] name = "re_int_histogram" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "criterion", "insta", @@ -5969,7 +5969,7 @@ dependencies = [ [[package]] name = "re_log" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "env_logger", "js-sys", @@ -5982,7 +5982,7 @@ dependencies = [ [[package]] name = "re_log_encoding" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "criterion", "ehttp", @@ -6010,7 +6010,7 @@ dependencies = [ [[package]] name = "re_log_types" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -6059,7 +6059,7 @@ dependencies = [ [[package]] name = "re_memory" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "backtrace", @@ -6094,7 +6094,7 @@ dependencies = [ [[package]] name = "re_protos" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "prost", "thiserror 1.0.65", @@ -6104,7 +6104,7 @@ dependencies = [ [[package]] name = "re_protos_builder" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "camino", "prost-build", @@ -6114,7 +6114,7 @@ dependencies = [ [[package]] name = "re_query" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -6168,7 +6168,7 @@ dependencies = [ [[package]] name = "re_renderer" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -6220,7 +6220,7 @@ dependencies = [ [[package]] name = "re_renderer_examples" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -6244,7 +6244,7 @@ dependencies = [ [[package]] name = "re_sdk" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "crossbeam", @@ -6279,7 +6279,7 @@ dependencies = [ [[package]] name = "re_sdk_comms" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "crossbeam", @@ -6295,7 +6295,7 @@ dependencies = [ [[package]] name = "re_selection_panel" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "egui", "egui_tiles", @@ -6322,7 +6322,7 @@ dependencies = [ [[package]] name = "re_smart_channel" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "crossbeam", "parking_lot", @@ -6333,7 +6333,7 @@ dependencies = [ [[package]] name = "re_string_interner" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "nohash-hasher", @@ -6345,7 +6345,7 @@ dependencies = [ [[package]] name = "re_time_panel" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "criterion", @@ -6374,7 +6374,7 @@ dependencies = [ [[package]] name = "re_tracing" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "puffin", "puffin_http", @@ -6385,7 +6385,7 @@ dependencies = [ [[package]] name = "re_tuid" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "criterion", "document-features", @@ -6398,7 +6398,7 @@ dependencies = [ [[package]] name = "re_types" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "array-init", @@ -6440,7 +6440,7 @@ dependencies = [ [[package]] name = "re_types_builder" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "arrow", @@ -6471,7 +6471,7 @@ dependencies = [ [[package]] name = "re_types_core" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "arrow", @@ -6496,7 +6496,7 @@ dependencies = [ [[package]] name = "re_ui" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "eframe", "egui", @@ -6522,7 +6522,7 @@ dependencies = [ [[package]] name = "re_video" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "bit-vec", "cfg_aliases 0.2.1", @@ -6550,7 +6550,7 @@ dependencies = [ [[package]] name = "re_view" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "arrow", @@ -6575,7 +6575,7 @@ dependencies = [ [[package]] name = "re_view_bar_chart" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "egui", "egui_plot", @@ -6593,7 +6593,7 @@ dependencies = [ [[package]] name = "re_view_dataframe" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "egui", @@ -6616,7 +6616,7 @@ dependencies = [ [[package]] name = "re_view_graph" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "egui", @@ -6640,7 +6640,7 @@ dependencies = [ [[package]] name = "re_view_map" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "bytemuck", "egui", @@ -6664,7 +6664,7 @@ dependencies = [ [[package]] name = "re_view_spatial" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -6708,7 +6708,7 @@ dependencies = [ [[package]] name = "re_view_tensor" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "bytemuck", @@ -6732,7 +6732,7 @@ dependencies = [ [[package]] name = "re_view_text_document" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "egui", "egui_commonmark", @@ -6747,7 +6747,7 @@ dependencies = [ [[package]] name = "re_view_text_log" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "egui", "egui_extras", @@ -6767,7 +6767,7 @@ dependencies = [ [[package]] name = "re_view_time_series" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "egui", "egui_plot", @@ -6789,7 +6789,7 @@ dependencies = [ [[package]] name = "re_viewer" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -6867,7 +6867,7 @@ dependencies = [ [[package]] name = "re_viewer_context" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", @@ -6884,6 +6884,7 @@ dependencies = [ "emath", "glam", "half", + "home", "image", "indexmap 2.6.0", "itertools 0.13.0", @@ -6923,7 +6924,7 @@ dependencies = [ [[package]] name = "re_viewport" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "egui", @@ -6946,7 +6947,7 @@ dependencies = [ [[package]] name = "re_viewport_blueprint" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "egui", @@ -6972,7 +6973,7 @@ dependencies = [ [[package]] name = "re_web_viewer_server" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "document-features", "re_analytics", @@ -6983,7 +6984,7 @@ dependencies = [ [[package]] name = "re_ws_comms" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "bincode", @@ -7180,7 +7181,7 @@ dependencies = [ [[package]] name = "rerun" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7221,7 +7222,7 @@ dependencies = [ [[package]] name = "rerun-cli" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "document-features", "mimalloc", @@ -7236,7 +7237,7 @@ dependencies = [ [[package]] name = "rerun-loader-rust-file" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "argh", @@ -7245,7 +7246,7 @@ dependencies = [ [[package]] name = "rerun_c" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "ahash", "infer", @@ -7259,7 +7260,7 @@ dependencies = [ [[package]] name = "rerun_py" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "arrow", "crossbeam", @@ -7392,7 +7393,7 @@ dependencies = [ [[package]] name = "roundtrip_annotation_context" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7402,7 +7403,7 @@ dependencies = [ [[package]] name = "roundtrip_arrows2d" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7412,7 +7413,7 @@ dependencies = [ [[package]] name = "roundtrip_arrows3d" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7422,7 +7423,7 @@ dependencies = [ [[package]] name = "roundtrip_boxes2d" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7432,7 +7433,7 @@ dependencies = [ [[package]] name = "roundtrip_boxes3d" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7442,7 +7443,7 @@ dependencies = [ [[package]] name = "roundtrip_depth_image" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7453,7 +7454,7 @@ dependencies = [ [[package]] name = "roundtrip_disconnected_space" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7463,7 +7464,7 @@ dependencies = [ [[package]] name = "roundtrip_image" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7476,7 +7477,7 @@ dependencies = [ [[package]] name = "roundtrip_line_strips2d" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7486,7 +7487,7 @@ dependencies = [ [[package]] name = "roundtrip_line_strips3d" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7496,7 +7497,7 @@ dependencies = [ [[package]] name = "roundtrip_pinhole" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7506,7 +7507,7 @@ dependencies = [ [[package]] name = "roundtrip_points2d" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7516,7 +7517,7 @@ dependencies = [ [[package]] name = "roundtrip_points3d" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7526,7 +7527,7 @@ dependencies = [ [[package]] name = "roundtrip_segmentation_image" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7537,7 +7538,7 @@ dependencies = [ [[package]] name = "roundtrip_tensor" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7548,7 +7549,7 @@ dependencies = [ [[package]] name = "roundtrip_text_document" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7558,7 +7559,7 @@ dependencies = [ [[package]] name = "roundtrip_text_log" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7568,7 +7569,7 @@ dependencies = [ [[package]] name = "roundtrip_transform3d" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7578,7 +7579,7 @@ dependencies = [ [[package]] name = "roundtrip_view_coordinates" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7588,7 +7589,7 @@ dependencies = [ [[package]] name = "roundtrip_visible_time_ranges" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -7604,7 +7605,7 @@ checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" [[package]] name = "run_wasm" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "cargo-run-wasm", "pico-args", @@ -7996,7 +7997,7 @@ dependencies = [ [[package]] name = "shared_recording" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "rerun", ] @@ -8175,7 +8176,7 @@ dependencies = [ [[package]] name = "snippets" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "itertools 0.13.0", "ndarray", @@ -8199,7 +8200,7 @@ dependencies = [ [[package]] name = "spawn_viewer" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "rerun", ] @@ -8250,7 +8251,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stdio" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "rerun", ] @@ -8427,7 +8428,7 @@ dependencies = [ [[package]] name = "template" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "rerun", ] @@ -8443,7 +8444,7 @@ dependencies = [ [[package]] name = "test_api" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -8458,7 +8459,7 @@ dependencies = [ [[package]] name = "test_data_density_graph" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "rand", @@ -8468,7 +8469,7 @@ dependencies = [ [[package]] name = "test_image_memory" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "mimalloc", "re_format", @@ -8477,7 +8478,7 @@ dependencies = [ [[package]] name = "test_pinhole_projection" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", @@ -8488,7 +8489,7 @@ dependencies = [ [[package]] name = "test_send_columns" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "re_chunk", "rerun", @@ -8496,7 +8497,7 @@ dependencies = [ [[package]] name = "test_ui_wakeup" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 12143ae8d7ab..2dfdffaed3fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ include = [ license = "MIT OR Apache-2.0" repository = "https://github.com/rerun-io/rerun" rust-version = "1.81" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" [workspace.dependencies] # When using alpha-release, always use exact version, e.g. `version = "=0.x.y-alpha.z" @@ -40,78 +40,78 @@ version = "0.21.0-alpha.1+dev" # re_log_types 0.3.0-alpha.0, NOT 0.3.0-alpha.4 even though it is newer and semver-compatible. # crates/build: -re_build_info = { path = "crates/build/re_build_info", version = "=0.21.0-alpha.1", default-features = false } -re_build_tools = { path = "crates/build/re_build_tools", version = "=0.21.0-alpha.1", default-features = false } -re_dev_tools = { path = "crates/build/re_dev_tools", version = "=0.21.0-alpha.1", default-features = false } -re_protos_builder = { path = "crates/build/re_protos_builder", version = "=0.21.0-alpha.1", default-features = false } -re_types_builder = { path = "crates/build/re_types_builder", version = "=0.21.0-alpha.1", default-features = false } +re_build_info = { path = "crates/build/re_build_info", version = "=0.22.0-alpha.1", default-features = false } +re_build_tools = { path = "crates/build/re_build_tools", version = "=0.22.0-alpha.1", default-features = false } +re_dev_tools = { path = "crates/build/re_dev_tools", version = "=0.22.0-alpha.1", default-features = false } +re_protos_builder = { path = "crates/build/re_protos_builder", version = "=0.22.0-alpha.1", default-features = false } +re_types_builder = { path = "crates/build/re_types_builder", version = "=0.22.0-alpha.1", default-features = false } # crates/store: -re_chunk = { path = "crates/store/re_chunk", version = "=0.21.0-alpha.1", default-features = false } -re_chunk_store = { path = "crates/store/re_chunk_store", version = "=0.21.0-alpha.1", default-features = false } -re_data_loader = { path = "crates/store/re_data_loader", version = "=0.21.0-alpha.1", default-features = false } -re_data_source = { path = "crates/store/re_data_source", version = "=0.21.0-alpha.1", default-features = false } -re_dataframe = { path = "crates/store/re_dataframe", version = "=0.21.0-alpha.1", default-features = false } -re_entity_db = { path = "crates/store/re_entity_db", version = "=0.21.0-alpha.1", default-features = false } -re_format_arrow = { path = "crates/store/re_format_arrow", version = "=0.21.0-alpha.1", default-features = false } -re_grpc_client = { path = "crates/store/re_grpc_client", version = "=0.21.0-alpha.1", default-features = false } -re_protos = { path = "crates/store/re_protos", version = "=0.21.0-alpha.1", default-features = false } -re_log_encoding = { path = "crates/store/re_log_encoding", version = "=0.21.0-alpha.1", default-features = false } -re_log_types = { path = "crates/store/re_log_types", version = "=0.21.0-alpha.1", default-features = false } -re_query = { path = "crates/store/re_query", version = "=0.21.0-alpha.1", default-features = false } -re_sdk_comms = { path = "crates/store/re_sdk_comms", version = "=0.21.0-alpha.1", default-features = false } -re_types = { path = "crates/store/re_types", version = "=0.21.0-alpha.1", default-features = false } -re_types_core = { path = "crates/store/re_types_core", version = "=0.21.0-alpha.1", default-features = false } -re_ws_comms = { path = "crates/store/re_ws_comms", version = "=0.21.0-alpha.1", default-features = false } +re_chunk = { path = "crates/store/re_chunk", version = "=0.22.0-alpha.1", default-features = false } +re_chunk_store = { path = "crates/store/re_chunk_store", version = "=0.22.0-alpha.1", default-features = false } +re_data_loader = { path = "crates/store/re_data_loader", version = "=0.22.0-alpha.1", default-features = false } +re_data_source = { path = "crates/store/re_data_source", version = "=0.22.0-alpha.1", default-features = false } +re_dataframe = { path = "crates/store/re_dataframe", version = "=0.22.0-alpha.1", default-features = false } +re_entity_db = { path = "crates/store/re_entity_db", version = "=0.22.0-alpha.1", default-features = false } +re_format_arrow = { path = "crates/store/re_format_arrow", version = "=0.22.0-alpha.1", default-features = false } +re_grpc_client = { path = "crates/store/re_grpc_client", version = "=0.22.0-alpha.1", default-features = false } +re_protos = { path = "crates/store/re_protos", version = "=0.22.0-alpha.1", default-features = false } +re_log_encoding = { path = "crates/store/re_log_encoding", version = "=0.22.0-alpha.1", default-features = false } +re_log_types = { path = "crates/store/re_log_types", version = "=0.22.0-alpha.1", default-features = false } +re_query = { path = "crates/store/re_query", version = "=0.22.0-alpha.1", default-features = false } +re_sdk_comms = { path = "crates/store/re_sdk_comms", version = "=0.22.0-alpha.1", default-features = false } +re_types = { path = "crates/store/re_types", version = "=0.22.0-alpha.1", default-features = false } +re_types_core = { path = "crates/store/re_types_core", version = "=0.22.0-alpha.1", default-features = false } +re_ws_comms = { path = "crates/store/re_ws_comms", version = "=0.22.0-alpha.1", default-features = false } # crates/top: -re_sdk = { path = "crates/top/re_sdk", version = "=0.21.0-alpha.1", default-features = false } -rerun = { path = "crates/top/rerun", version = "=0.21.0-alpha.1", default-features = false } -rerun_c = { path = "crates/top/rerun_c", version = "=0.21.0-alpha.1", default-features = false } -rerun-cli = { path = "crates/top/rerun-cli", version = "=0.21.0-alpha.1", default-features = false } +re_sdk = { path = "crates/top/re_sdk", version = "=0.22.0-alpha.1", default-features = false } +rerun = { path = "crates/top/rerun", version = "=0.22.0-alpha.1", default-features = false } +rerun_c = { path = "crates/top/rerun_c", version = "=0.22.0-alpha.1", default-features = false } +rerun-cli = { path = "crates/top/rerun-cli", version = "=0.22.0-alpha.1", default-features = false } # crates/utils: -re_analytics = { path = "crates/utils/re_analytics", version = "=0.21.0-alpha.1", default-features = false } -re_capabilities = { path = "crates/utils/re_capabilities", version = "=0.21.0-alpha.1", default-features = false } -re_case = { path = "crates/utils/re_case", version = "=0.21.0-alpha.1", default-features = false } -re_crash_handler = { path = "crates/utils/re_crash_handler", version = "=0.21.0-alpha.1", default-features = false } -re_error = { path = "crates/utils/re_error", version = "=0.21.0-alpha.1", default-features = false } -re_format = { path = "crates/utils/re_format", version = "=0.21.0-alpha.1", default-features = false } -re_int_histogram = { path = "crates/utils/re_int_histogram", version = "=0.21.0-alpha.1", default-features = false } -re_log = { path = "crates/utils/re_log", version = "=0.21.0-alpha.1", default-features = false } -re_memory = { path = "crates/utils/re_memory", version = "=0.21.0-alpha.1", default-features = false } -re_smart_channel = { path = "crates/utils/re_smart_channel", version = "=0.21.0-alpha.1", default-features = false } -re_string_interner = { path = "crates/utils/re_string_interner", version = "=0.21.0-alpha.1", default-features = false } -re_tracing = { path = "crates/utils/re_tracing", version = "=0.21.0-alpha.1", default-features = false } -re_tuid = { path = "crates/utils/re_tuid", version = "=0.21.0-alpha.1", default-features = false } -re_video = { path = "crates/utils/re_video", version = "=0.21.0-alpha.1", default-features = false } +re_analytics = { path = "crates/utils/re_analytics", version = "=0.22.0-alpha.1", default-features = false } +re_capabilities = { path = "crates/utils/re_capabilities", version = "=0.22.0-alpha.1", default-features = false } +re_case = { path = "crates/utils/re_case", version = "=0.22.0-alpha.1", default-features = false } +re_crash_handler = { path = "crates/utils/re_crash_handler", version = "=0.22.0-alpha.1", default-features = false } +re_error = { path = "crates/utils/re_error", version = "=0.22.0-alpha.1", default-features = false } +re_format = { path = "crates/utils/re_format", version = "=0.22.0-alpha.1", default-features = false } +re_int_histogram = { path = "crates/utils/re_int_histogram", version = "=0.22.0-alpha.1", default-features = false } +re_log = { path = "crates/utils/re_log", version = "=0.22.0-alpha.1", default-features = false } +re_memory = { path = "crates/utils/re_memory", version = "=0.22.0-alpha.1", default-features = false } +re_smart_channel = { path = "crates/utils/re_smart_channel", version = "=0.22.0-alpha.1", default-features = false } +re_string_interner = { path = "crates/utils/re_string_interner", version = "=0.22.0-alpha.1", default-features = false } +re_tracing = { path = "crates/utils/re_tracing", version = "=0.22.0-alpha.1", default-features = false } +re_tuid = { path = "crates/utils/re_tuid", version = "=0.22.0-alpha.1", default-features = false } +re_video = { path = "crates/utils/re_video", version = "=0.22.0-alpha.1", default-features = false } # crates/viewer: -re_blueprint_tree = { path = "crates/viewer/re_blueprint_tree", version = "=0.21.0-alpha.1", default-features = false } -re_component_ui = { path = "crates/viewer/re_component_ui", version = "=0.21.0-alpha.1", default-features = false } -re_context_menu = { path = "crates/viewer/re_context_menu", version = "=0.21.0-alpha.1", default-features = false } -re_data_ui = { path = "crates/viewer/re_data_ui", version = "=0.21.0-alpha.1", default-features = false } -re_chunk_store_ui = { path = "crates/viewer/re_chunk_store_ui", version = "=0.21.0-alpha.1", default-features = false } -re_renderer = { path = "crates/viewer/re_renderer", version = "=0.21.0-alpha.1", default-features = false } -re_renderer_examples = { path = "crates/viewer/re_renderer_examples", version = "=0.21.0-alpha.1", default-features = false } -re_selection_panel = { path = "crates/viewer/re_selection_panel", version = "=0.21.0-alpha.1", default-features = false } -re_view = { path = "crates/viewer/re_view", version = "=0.21.0-alpha.1", default-features = false } -re_view_bar_chart = { path = "crates/viewer/re_view_bar_chart", version = "=0.21.0-alpha.1", default-features = false } -re_view_spatial = { path = "crates/viewer/re_view_spatial", version = "=0.21.0-alpha.1", default-features = false } -re_view_dataframe = { path = "crates/viewer/re_view_dataframe", version = "=0.21.0-alpha.1", default-features = false } -re_view_graph = { path = "crates/viewer/re_view_graph", version = "=0.21.0-alpha.1", default-features = false } -re_view_map = { path = "crates/viewer/re_view_map", version = "=0.21.0-alpha.1", default-features = false } -re_view_tensor = { path = "crates/viewer/re_view_tensor", version = "=0.21.0-alpha.1", default-features = false } -re_view_text_document = { path = "crates/viewer/re_view_text_document", version = "=0.21.0-alpha.1", default-features = false } -re_view_text_log = { path = "crates/viewer/re_view_text_log", version = "=0.21.0-alpha.1", default-features = false } -re_view_time_series = { path = "crates/viewer/re_view_time_series", version = "=0.21.0-alpha.1", default-features = false } -re_time_panel = { path = "crates/viewer/re_time_panel", version = "=0.21.0-alpha.1", default-features = false } -re_ui = { path = "crates/viewer/re_ui", version = "=0.21.0-alpha.1", default-features = false } -re_viewer = { path = "crates/viewer/re_viewer", version = "=0.21.0-alpha.1", default-features = false } -re_viewer_context = { path = "crates/viewer/re_viewer_context", version = "=0.21.0-alpha.1", default-features = false } -re_viewport = { path = "crates/viewer/re_viewport", version = "=0.21.0-alpha.1", default-features = false } -re_viewport_blueprint = { path = "crates/viewer/re_viewport_blueprint", version = "=0.21.0-alpha.1", default-features = false } -re_web_viewer_server = { path = "crates/viewer/re_web_viewer_server", version = "=0.21.0-alpha.1", default-features = false } +re_blueprint_tree = { path = "crates/viewer/re_blueprint_tree", version = "=0.22.0-alpha.1", default-features = false } +re_component_ui = { path = "crates/viewer/re_component_ui", version = "=0.22.0-alpha.1", default-features = false } +re_context_menu = { path = "crates/viewer/re_context_menu", version = "=0.22.0-alpha.1", default-features = false } +re_data_ui = { path = "crates/viewer/re_data_ui", version = "=0.22.0-alpha.1", default-features = false } +re_chunk_store_ui = { path = "crates/viewer/re_chunk_store_ui", version = "=0.22.0-alpha.1", default-features = false } +re_renderer = { path = "crates/viewer/re_renderer", version = "=0.22.0-alpha.1", default-features = false } +re_renderer_examples = { path = "crates/viewer/re_renderer_examples", version = "=0.22.0-alpha.1", default-features = false } +re_selection_panel = { path = "crates/viewer/re_selection_panel", version = "=0.22.0-alpha.1", default-features = false } +re_view = { path = "crates/viewer/re_view", version = "=0.22.0-alpha.1", default-features = false } +re_view_bar_chart = { path = "crates/viewer/re_view_bar_chart", version = "=0.22.0-alpha.1", default-features = false } +re_view_spatial = { path = "crates/viewer/re_view_spatial", version = "=0.22.0-alpha.1", default-features = false } +re_view_dataframe = { path = "crates/viewer/re_view_dataframe", version = "=0.22.0-alpha.1", default-features = false } +re_view_graph = { path = "crates/viewer/re_view_graph", version = "=0.22.0-alpha.1", default-features = false } +re_view_map = { path = "crates/viewer/re_view_map", version = "=0.22.0-alpha.1", default-features = false } +re_view_tensor = { path = "crates/viewer/re_view_tensor", version = "=0.22.0-alpha.1", default-features = false } +re_view_text_document = { path = "crates/viewer/re_view_text_document", version = "=0.22.0-alpha.1", default-features = false } +re_view_text_log = { path = "crates/viewer/re_view_text_log", version = "=0.22.0-alpha.1", default-features = false } +re_view_time_series = { path = "crates/viewer/re_view_time_series", version = "=0.22.0-alpha.1", default-features = false } +re_time_panel = { path = "crates/viewer/re_time_panel", version = "=0.22.0-alpha.1", default-features = false } +re_ui = { path = "crates/viewer/re_ui", version = "=0.22.0-alpha.1", default-features = false } +re_viewer = { path = "crates/viewer/re_viewer", version = "=0.22.0-alpha.1", default-features = false } +re_viewer_context = { path = "crates/viewer/re_viewer_context", version = "=0.22.0-alpha.1", default-features = false } +re_viewport = { path = "crates/viewer/re_viewport", version = "=0.22.0-alpha.1", default-features = false } +re_viewport_blueprint = { path = "crates/viewer/re_viewport_blueprint", version = "=0.22.0-alpha.1", default-features = false } +re_web_viewer_server = { path = "crates/viewer/re_web_viewer_server", version = "=0.22.0-alpha.1", default-features = false } # Rerun crates in other repos: ewebsock = "0.8.0" @@ -193,6 +193,7 @@ glob = "0.3" gltf = "1.1" half = "2.3.1" hexasphere = "14.1.0" +home = "=0.5.9" image = { version = "0.25", default-features = false } indent = "0.1" indexmap = "2.1" # Version chosen to align with other dependencies diff --git a/crates/build/re_protos_builder/src/lib.rs b/crates/build/re_protos_builder/src/lib.rs index 6f382e89fb48..ddbbce158a99 100644 --- a/crates/build/re_protos_builder/src/lib.rs +++ b/crates/build/re_protos_builder/src/lib.rs @@ -32,7 +32,7 @@ pub fn generate_rust_code( std::process::exit(1); } _ => { - panic!("{err:?}"); + panic!("{err}"); } } } diff --git a/crates/build/re_types_builder/src/codegen/docs/snippets_ref.rs b/crates/build/re_types_builder/src/codegen/docs/snippets_ref.rs index 47fe4e3cfeac..322785041e9c 100644 --- a/crates/build/re_types_builder/src/codegen/docs/snippets_ref.rs +++ b/crates/build/re_types_builder/src/codegen/docs/snippets_ref.rs @@ -631,9 +631,8 @@ fn is_speculative(any_name: &str) -> anyhow::Result { let minor: u32 = env!("CARGO_PKG_VERSION_MINOR") .parse() .context("couldn't parse minor crate version")?; - let pre = env!("CARGO_PKG_VERSION_PRE"); - minor < 21 || !pre.is_empty() + minor < 21 }; const RELEASED_IN_0_21: &[&str] = &[ diff --git a/crates/build/re_types_builder/src/codegen/rust/arrow.rs b/crates/build/re_types_builder/src/codegen/rust/arrow.rs index 890f9d95004b..303dbf684637 100644 --- a/crates/build/re_types_builder/src/codegen/rust/arrow.rs +++ b/crates/build/re_types_builder/src/codegen/rust/arrow.rs @@ -7,7 +7,7 @@ use quote::quote; /// `(Datatype, is_recursive)` /// /// If `is_recursive` is set to `true`, -/// then the generate code will often be shorter, as it it will +/// then the generated code will often be shorter, as it will /// defer to calling `arrow_datatype()` on the inner type. pub struct ArrowDataTypeTokenizer<'a>(pub &'a ::arrow2::datatypes::DataType, pub bool); diff --git a/crates/build/re_types_builder/src/codegen/rust/serializer.rs b/crates/build/re_types_builder/src/codegen/rust/serializer.rs index 8f8063923dc4..6156c4895bc4 100644 --- a/crates/build/re_types_builder/src/codegen/rust/serializer.rs +++ b/crates/build/re_types_builder/src/codegen/rust/serializer.rs @@ -843,7 +843,7 @@ fn quote_arrow_field_serializer( // if we make the C++ and Python codegen match the rust behavior or // make our comparison tests more lenient. // - // This workaround does not apply if we don't have any validity validity on the outer type. + // This workaround does not apply if we don't have any validity on the outer type. // (as it is always the case with unions where the nullability is encoded as a separate variant) let quoted_inner_validity = if let (true, DataType::FixedSizeList(_, count)) = (elements_are_nullable, datatype.to_logical_type()) diff --git a/crates/store/re_chunk/src/iter.rs b/crates/store/re_chunk/src/iter.rs index 571c5995c48b..1534d9ac0a28 100644 --- a/crates/store/re_chunk/src/iter.rs +++ b/crates/store/re_chunk/src/iter.rs @@ -710,7 +710,7 @@ impl Chunk { Err(err) => { if cfg!(debug_assertions) { panic!( - "deserialization failed for {}, data discarded: {}", + "[DEBUG-ONLY] deserialization failed for {}, data discarded: {}", C::name(), re_error::format_ref(&err), ); diff --git a/crates/store/re_types/definitions/rerun/archetypes/ellipsoids3d.fbs b/crates/store/re_types/definitions/rerun/archetypes/ellipsoids3d.fbs index 0fb824dc7017..469ff7009186 100644 --- a/crates/store/re_types/definitions/rerun/archetypes/ellipsoids3d.fbs +++ b/crates/store/re_types/definitions/rerun/archetypes/ellipsoids3d.fbs @@ -12,7 +12,7 @@ namespace rerun.archetypes; /// Some of its component are repeated here for convenience. /// If there's more instance poses than half sizes, the last half size will be repeated for the remaining poses. /// -/// \example archetypes/ellipsoids3d_simple !api title="Covariance ellipsoid" image="https://static.rerun.io/elliopsoid3d_simple/bd5d46e61b80ae44792b52ee07d750a7137002ea/1200w.png" +/// \example archetypes/ellipsoids3d_simple title="Covariance ellipsoid" image="https://static.rerun.io/elliopsoid3d_simple/bd5d46e61b80ae44792b52ee07d750a7137002ea/1200w.png" table Ellipsoids3D ( "attr.rust.derive": "PartialEq", "attr.rust.new_pub_crate", diff --git a/crates/store/re_types/definitions/rerun/archetypes/graph_edges.fbs b/crates/store/re_types/definitions/rerun/archetypes/graph_edges.fbs index 337787158f71..c85a4e58e4bb 100644 --- a/crates/store/re_types/definitions/rerun/archetypes/graph_edges.fbs +++ b/crates/store/re_types/definitions/rerun/archetypes/graph_edges.fbs @@ -10,10 +10,8 @@ namespace rerun.archetypes; /// \example archetypes/graph_directed title="Simple directed graph" image="https://static.rerun.io/graph_directed/ca29a37b65e1e0b6482251dce401982a0bc568fa/1200w.png" table GraphEdges ( "attr.docs.category": "Graph", - "attr.docs.unreleased", "attr.docs.view_types": "GraphView", - "attr.rust.derive": "PartialEq, Eq", - "attr.rerun.experimental" + "attr.rust.derive": "PartialEq, Eq" ) { // --- Required --- diff --git a/crates/store/re_types/definitions/rerun/archetypes/graph_nodes.fbs b/crates/store/re_types/definitions/rerun/archetypes/graph_nodes.fbs index 142a88dd2444..d169b97bd25b 100644 --- a/crates/store/re_types/definitions/rerun/archetypes/graph_nodes.fbs +++ b/crates/store/re_types/definitions/rerun/archetypes/graph_nodes.fbs @@ -8,10 +8,8 @@ namespace rerun.archetypes; /// \example archetypes/graph_directed title="Simple directed graph" image="https://static.rerun.io/graph_directed/ca29a37b65e1e0b6482251dce401982a0bc568fa/1200w.png" table GraphNodes ( "attr.docs.category": "Graph", - "attr.docs.unreleased", "attr.docs.view_types": "GraphView", - "attr.rust.derive": "PartialEq", - "attr.rerun.experimental" + "attr.rust.derive": "PartialEq" ) { // --- Required --- diff --git a/crates/store/re_types/definitions/rerun/blueprint/archetypes/near_clip_plane.fbs b/crates/store/re_types/definitions/rerun/blueprint/archetypes/near_clip_plane.fbs index a157d67a2982..9875dfde1004 100644 --- a/crates/store/re_types/definitions/rerun/blueprint/archetypes/near_clip_plane.fbs +++ b/crates/store/re_types/definitions/rerun/blueprint/archetypes/near_clip_plane.fbs @@ -2,7 +2,6 @@ namespace rerun.blueprint.archetypes; /// Controls the distance to the near clip plane in 3D scene units. table NearClipPlane ( - "attr.docs.unreleased", "attr.rerun.scope": "blueprint", "attr.rust.derive": "Copy" ) { diff --git a/crates/store/re_types/definitions/rerun/blueprint/components/near_clip_plane.fbs b/crates/store/re_types/definitions/rerun/blueprint/components/near_clip_plane.fbs index 200fc64ef33b..aa7aa3582d1f 100644 --- a/crates/store/re_types/definitions/rerun/blueprint/components/near_clip_plane.fbs +++ b/crates/store/re_types/definitions/rerun/blueprint/components/near_clip_plane.fbs @@ -6,8 +6,7 @@ namespace rerun.blueprint.components; struct NearClipPlane ( "attr.rerun.scope": "blueprint", "attr.rust.derive": "Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable", - "attr.rust.repr": "transparent", - "attr.docs.unreleased" + "attr.rust.repr": "transparent" ) { /// Distance to the near clip plane in 3D scene units. near_clip_plane: rerun.datatypes.Float32 (order: 100); diff --git a/crates/store/re_types/definitions/rerun/blueprint/views/graph.fbs b/crates/store/re_types/definitions/rerun/blueprint/views/graph.fbs index 848ad4f3255a..7710b0856c02 100644 --- a/crates/store/re_types/definitions/rerun/blueprint/views/graph.fbs +++ b/crates/store/re_types/definitions/rerun/blueprint/views/graph.fbs @@ -4,8 +4,7 @@ namespace rerun.blueprint.views; /// /// \example views/graph title="Use a blueprint to create a graph view." image="https://static.rerun.io/graph_lattice/f9169da9c3f35b7260c9d74cd5be5fe710aec6a8/1200w.png" table GraphView ( - "attr.rerun.view_identifier": "Graph", - "attr.docs.unreleased" + "attr.rerun.view_identifier": "Graph" ) { /// Everything within these bounds is guaranteed to be visible. /// diff --git a/crates/store/re_types/definitions/rerun/components/graph_edge.fbs b/crates/store/re_types/definitions/rerun/components/graph_edge.fbs index 1f97a2e6c506..435dee9efa5a 100644 --- a/crates/store/re_types/definitions/rerun/components/graph_edge.fbs +++ b/crates/store/re_types/definitions/rerun/components/graph_edge.fbs @@ -4,7 +4,6 @@ namespace rerun.components; /// An edge in a graph connecting two nodes. table GraphEdge ( - "attr.docs.unreleased", "attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord", "attr.rust.repr": "transparent" ) { diff --git a/crates/store/re_types/definitions/rerun/components/graph_node.fbs b/crates/store/re_types/definitions/rerun/components/graph_node.fbs index 7867665a380a..3af3d6f2f185 100644 --- a/crates/store/re_types/definitions/rerun/components/graph_node.fbs +++ b/crates/store/re_types/definitions/rerun/components/graph_node.fbs @@ -4,7 +4,6 @@ namespace rerun.components; /// A string-based ID representing a node in a graph. table GraphNode ( - "attr.docs.unreleased", "attr.python.aliases": "str", "attr.python.array_aliases": "str, Sequence[str]", "attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord, Hash", diff --git a/crates/store/re_types/definitions/rerun/components/graph_type.fbs b/crates/store/re_types/definitions/rerun/components/graph_type.fbs index 283e3a2b93b4..1348c6b20479 100644 --- a/crates/store/re_types/definitions/rerun/components/graph_type.fbs +++ b/crates/store/re_types/definitions/rerun/components/graph_type.fbs @@ -4,7 +4,6 @@ namespace rerun.components; /// Specifies if a graph has directed or undirected edges. enum GraphType: ubyte ( - "attr.docs.unreleased", "attr.rust.derive": "Default, PartialEq, Eq" ) { /// Invalid value. Won't show up in generated types. diff --git a/crates/store/re_types/definitions/rerun/components/plane3d.fbs b/crates/store/re_types/definitions/rerun/components/plane3d.fbs index e60aa4efdf58..21c8b139d1c4 100644 --- a/crates/store/re_types/definitions/rerun/components/plane3d.fbs +++ b/crates/store/re_types/definitions/rerun/components/plane3d.fbs @@ -10,7 +10,6 @@ namespace rerun.components; /// datastore as provided, when used in the Viewer, planes will always be normalized. /// I.e. the plane with xyz = (2, 0, 0), d = 1 is equivalent to xyz = (1, 0, 0), d = 0.5 struct Plane3D ( - "attr.docs.unreleased", "attr.rust.derive": "Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable", "attr.rust.repr": "transparent" ) { diff --git a/crates/store/re_types/definitions/rerun/components/recording_uri.fbs b/crates/store/re_types/definitions/rerun/components/recording_uri.fbs index e27204f5251d..22966e126eb4 100644 --- a/crates/store/re_types/definitions/rerun/components/recording_uri.fbs +++ b/crates/store/re_types/definitions/rerun/components/recording_uri.fbs @@ -4,8 +4,7 @@ namespace rerun.components; /// A recording URI (Uniform Resource Identifier). table RecordingUri ( - "attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord, Hash", - "attr.docs.unreleased" + "attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord, Hash" ) { recording_uri: rerun.datatypes.Utf8 (order: 100); } diff --git a/crates/store/re_types/definitions/rerun/datatypes.fbs b/crates/store/re_types/definitions/rerun/datatypes.fbs index 5772f4c3b8d5..fa325413e155 100644 --- a/crates/store/re_types/definitions/rerun/datatypes.fbs +++ b/crates/store/re_types/definitions/rerun/datatypes.fbs @@ -27,7 +27,6 @@ include "./datatypes/rgba32.fbs"; include "./datatypes/rotation_axis_angle.fbs"; include "./datatypes/tensor_buffer.fbs"; include "./datatypes/tensor_data.fbs"; -include "./datatypes/tensor_dimension.fbs"; include "./datatypes/tensor_dimension_selection.fbs"; include "./datatypes/time_int.fbs"; include "./datatypes/uint16.fbs"; diff --git a/crates/store/re_types/definitions/rerun/datatypes/plane3d.fbs b/crates/store/re_types/definitions/rerun/datatypes/plane3d.fbs index a490f8450481..acfeb4741ce8 100644 --- a/crates/store/re_types/definitions/rerun/datatypes/plane3d.fbs +++ b/crates/store/re_types/definitions/rerun/datatypes/plane3d.fbs @@ -10,7 +10,6 @@ namespace rerun.datatypes; /// datastore as provided, when used in the Viewer, planes will always be normalized. /// I.e. the plane with xyz = (2, 0, 0), d = 1 is equivalent to xyz = (1, 0, 0), d = 0.5 struct Plane3D ( - "attr.docs.unreleased", "attr.arrow.transparent", "attr.python.array_aliases": "npt.NDArray[Any], npt.ArrayLike, Sequence[Sequence[float]]", "attr.rust.derive": "Copy, PartialEq, PartialOrd, bytemuck::Pod, bytemuck::Zeroable", diff --git a/crates/store/re_types/definitions/rerun/datatypes/tensor_data.fbs b/crates/store/re_types/definitions/rerun/datatypes/tensor_data.fbs index 1624be6e00f3..6301c33c7abb 100644 --- a/crates/store/re_types/definitions/rerun/datatypes/tensor_data.fbs +++ b/crates/store/re_types/definitions/rerun/datatypes/tensor_data.fbs @@ -19,8 +19,17 @@ table TensorData ( "attr.python.array_aliases": "npt.ArrayLike", "attr.rust.derive": "PartialEq," ) { - /// The shape of the tensor, including optional names for each dimension. - shape: [rerun.datatypes.TensorDimension] (order: 200); + /// The shape of the tensor, i.e. the length of each dimension. + shape: [uint64] (order: 200); + + /// The names of the dimensions of the tensor (optional). + /// + /// If set, should be the same length as [datatypes.TensorData.shape]. + /// If it has a different length your names may show up improperly, + /// and some constructors may produce a warning or even an error. + /// + /// Example: `["height", "width", "channel", "batch"]`. + names: [string] (order: 250, nullable); /// The content/data. buffer: rerun.datatypes.TensorBuffer (order: 300); diff --git a/crates/store/re_types/definitions/rerun/datatypes/tensor_dimension.fbs b/crates/store/re_types/definitions/rerun/datatypes/tensor_dimension.fbs deleted file mode 100644 index 7d755a8b81e5..000000000000 --- a/crates/store/re_types/definitions/rerun/datatypes/tensor_dimension.fbs +++ /dev/null @@ -1,15 +0,0 @@ -namespace rerun.datatypes; - -// --- - -/// A single dimension within a multi-dimensional tensor. -// TODO(jleibs): Support for stride. -table TensorDimension ( - "attr.rust.derive_only": "Clone, Default, Eq, PartialEq" -) { - /// The length of this dimension. - size: ulong (order: 100); - - /// The name of this dimension, e.g. "width", "height", "channel", "batch', …. - name: string (order: 200, nullable); -} diff --git a/crates/store/re_types/definitions/rerun/datatypes/utf8_pair.fbs b/crates/store/re_types/definitions/rerun/datatypes/utf8_pair.fbs index 9acbb85a5052..051722a1e200 100644 --- a/crates/store/re_types/definitions/rerun/datatypes/utf8_pair.fbs +++ b/crates/store/re_types/definitions/rerun/datatypes/utf8_pair.fbs @@ -2,7 +2,6 @@ namespace rerun.datatypes; /// Stores a tuple of UTF-8 strings. table Utf8Pair ( - "attr.docs.unreleased", "attr.python.aliases": "Tuple[datatypes.Utf8Like, datatypes.Utf8Like]", "attr.python.array_aliases": "npt.NDArray[np.str_]", "attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord" diff --git a/crates/store/re_types/src/archetypes/depth_image_ext.rs b/crates/store/re_types/src/archetypes/depth_image_ext.rs index b1c7044c0914..af72285a3edd 100644 --- a/crates/store/re_types/src/archetypes/depth_image_ext.rs +++ b/crates/store/re_types/src/archetypes/depth_image_ext.rs @@ -20,7 +20,7 @@ impl DepthImage { let tensor_data: TensorData = data .try_into() .map_err(ImageConstructionError::TensorDataConversion)?; - let shape = tensor_data.shape; + let TensorData { shape, buffer, .. } = tensor_data; let non_empty_dim_inds = find_non_empty_dim_indices(&shape); @@ -28,13 +28,11 @@ impl DepthImage { return Err(ImageConstructionError::BadImageShape(shape)); } - let (blob, datatype) = blob_and_datatype_from_tensor(tensor_data.buffer); + let (blob, datatype) = blob_and_datatype_from_tensor(buffer); - let (height, width) = (&shape[non_empty_dim_inds[0]], &shape[non_empty_dim_inds[1]]); - let height = height.size as u32; - let width = width.size as u32; + let (height, width) = (shape[non_empty_dim_inds[0]], shape[non_empty_dim_inds[1]]); - let image_format = ImageFormat::depth([width, height], datatype); + let image_format = ImageFormat::depth([width as u32, height as u32], datatype); Ok(Self { buffer: blob.into(), diff --git a/crates/store/re_types/src/archetypes/ellipsoids3d.rs b/crates/store/re_types/src/archetypes/ellipsoids3d.rs index bc6ee14a53f6..034fbb9f6047 100644 --- a/crates/store/re_types/src/archetypes/ellipsoids3d.rs +++ b/crates/store/re_types/src/archetypes/ellipsoids3d.rs @@ -27,6 +27,58 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// Note that orienting and placing the ellipsoids/spheres is handled via `[archetypes.InstancePoses3D]`. /// Some of its component are repeated here for convenience. /// If there's more instance poses than half sizes, the last half size will be repeated for the remaining poses. +/// +/// ## Example +/// +/// ### Covariance ellipsoid +/// ```ignore +/// use rand::distributions::Distribution; +/// +/// fn main() -> Result<(), Box> { +/// let rec = rerun::RecordingStreamBuilder::new("rerun_example_ellipsoid_simple").spawn()?; +/// +/// let sigmas: [f32; 3] = [5., 3., 1.]; +/// +/// let mut rng = rand::thread_rng(); +/// let normal = rand_distr::Normal::new(0.0, 1.0)?; +/// +/// rec.log( +/// "points", +/// &rerun::Points3D::new((0..50_000).map(|_| { +/// ( +/// sigmas[0] * normal.sample(&mut rng), +/// sigmas[1] * normal.sample(&mut rng), +/// sigmas[2] * normal.sample(&mut rng), +/// ) +/// })) +/// .with_radii([0.02]) +/// .with_colors([rerun::Color::from_rgb(188, 77, 185)]), +/// )?; +/// +/// rec.log( +/// "ellipsoid", +/// &rerun::Ellipsoids3D::from_centers_and_half_sizes( +/// [(0.0, 0.0, 0.0), (0.0, 0.0, 0.0)], +/// [sigmas, [sigmas[0] * 3., sigmas[1] * 3., sigmas[2] * 3.]], +/// ) +/// .with_colors([ +/// rerun::Color::from_rgb(255, 255, 0), +/// rerun::Color::from_rgb(64, 64, 0), +/// ]), +/// )?; +/// +/// Ok(()) +/// } +/// ``` +///
+/// +/// +/// +/// +/// +/// +/// +///
#[derive(Clone, Debug, PartialEq)] pub struct Ellipsoids3D { /// For each ellipsoid, half of its size on its three axes. diff --git a/crates/store/re_types/src/archetypes/graph_edges.rs b/crates/store/re_types/src/archetypes/graph_edges.rs index d30dfea19a76..19fa08c8c526 100644 --- a/crates/store/re_types/src/archetypes/graph_edges.rs +++ b/crates/store/re_types/src/archetypes/graph_edges.rs @@ -22,8 +22,6 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// /// By default, edges are undirected. /// -/// ⚠️ **This type is experimental and may be removed in future versions** -/// /// ## Example /// /// ### Simple directed graph diff --git a/crates/store/re_types/src/archetypes/graph_nodes.rs b/crates/store/re_types/src/archetypes/graph_nodes.rs index 3f3e707e185f..5931330051f3 100644 --- a/crates/store/re_types/src/archetypes/graph_nodes.rs +++ b/crates/store/re_types/src/archetypes/graph_nodes.rs @@ -20,8 +20,6 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// **Archetype**: A list of nodes in a graph with optional labels, colors, etc. /// -/// ⚠️ **This type is experimental and may be removed in future versions** -/// /// ## Example /// /// ### Simple directed graph diff --git a/crates/store/re_types/src/archetypes/image_ext.rs b/crates/store/re_types/src/archetypes/image_ext.rs index 1beff5061887..0304cecb27fe 100644 --- a/crates/store/re_types/src/archetypes/image_ext.rs +++ b/crates/store/re_types/src/archetypes/image_ext.rs @@ -33,17 +33,17 @@ impl Image { let tensor_data: TensorData = data .try_into() .map_err(ImageConstructionError::TensorDataConversion)?; - let shape = tensor_data.shape; + let TensorData { shape, buffer, .. } = tensor_data; let non_empty_dim_inds = find_non_empty_dim_indices(&shape); let is_shape_correct = match color_model { ColorModel::L => non_empty_dim_inds.len() == 2, ColorModel::RGB | ColorModel::BGR => { - non_empty_dim_inds.len() == 3 && shape[non_empty_dim_inds[2]].size == 3 + non_empty_dim_inds.len() == 3 && shape[non_empty_dim_inds[2]] == 3 } ColorModel::RGBA | ColorModel::BGRA => { - non_empty_dim_inds.len() == 3 && shape[non_empty_dim_inds[2]].size == 4 + non_empty_dim_inds.len() == 3 && shape[non_empty_dim_inds[2]] == 4 } }; @@ -51,15 +51,13 @@ impl Image { return Err(ImageConstructionError::BadImageShape(shape)); } - let (blob, datatype) = blob_and_datatype_from_tensor(tensor_data.buffer); + let (blob, datatype) = blob_and_datatype_from_tensor(buffer); - let (height, width) = (&shape[non_empty_dim_inds[0]], &shape[non_empty_dim_inds[1]]); - let height = height.size as u32; - let width = width.size as u32; + let (height, width) = (shape[non_empty_dim_inds[0]], shape[non_empty_dim_inds[1]]); let image_format = ImageFormat { - width, - height, + width: width as _, + height: height as _, pixel_format: None, channel_datatype: Some(datatype), color_model: Some(color_model), diff --git a/crates/store/re_types/src/archetypes/segmentation_image_ext.rs b/crates/store/re_types/src/archetypes/segmentation_image_ext.rs index 4c2f71375b39..a90856eb24d3 100644 --- a/crates/store/re_types/src/archetypes/segmentation_image_ext.rs +++ b/crates/store/re_types/src/archetypes/segmentation_image_ext.rs @@ -19,7 +19,7 @@ impl SegmentationImage { let tensor_data: TensorData = data .try_into() .map_err(ImageConstructionError::TensorDataConversion)?; - let shape = tensor_data.shape; + let TensorData { shape, buffer, .. } = tensor_data; let non_empty_dim_inds = find_non_empty_dim_indices(&shape); @@ -27,13 +27,11 @@ impl SegmentationImage { return Err(ImageConstructionError::BadImageShape(shape)); } - let (blob, datatype) = blob_and_datatype_from_tensor(tensor_data.buffer); + let (blob, datatype) = blob_and_datatype_from_tensor(buffer); - let (height, width) = (&shape[non_empty_dim_inds[0]], &shape[non_empty_dim_inds[1]]); - let height = height.size as u32; - let width = width.size as u32; + let (height, width) = (shape[non_empty_dim_inds[0]], shape[non_empty_dim_inds[1]]); - let image_format = ImageFormat::segmentation([width, height], datatype); + let image_format = ImageFormat::segmentation([width as _, height as _], datatype); Ok(Self { buffer: blob.into(), diff --git a/crates/store/re_types/src/archetypes/tensor_ext.rs b/crates/store/re_types/src/archetypes/tensor_ext.rs index c7063b0b6264..2bfa7c1f08ef 100644 --- a/crates/store/re_types/src/archetypes/tensor_ext.rs +++ b/crates/store/re_types/src/archetypes/tensor_ext.rs @@ -1,4 +1,4 @@ -use crate::datatypes::{TensorData, TensorDimension}; +use crate::datatypes::TensorData; use re_types_core::ArrowString; @@ -24,37 +24,16 @@ impl Tensor { /// Update the `names` of the contained [`TensorData`] dimensions. /// - /// Any existing Dimension names will be overwritten. + /// Any existing names will be overwritten. /// - /// If too many, or too few names are provided, this function will warn and only - /// update the subset of names that it can. - pub fn with_dim_names(self, names: impl IntoIterator>) -> Self { - let names: Vec<_> = names.into_iter().map(|x| Some(x.into())).collect(); - if names.len() != self.data.0.shape.len() { - re_log::warn_once!( - "Wrong number of names provided for tensor dimension. {} provided but {} expected.", - names.len(), - self.data.0.shape.len(), - ); - } - Self { - data: TensorData { - shape: self - .data - .0 - .shape - .into_iter() - .zip(names.into_iter().chain(std::iter::repeat(None))) - .map(|(dim, name)| TensorDimension { - size: dim.size, - name: name.or(dim.name), - }) - .collect(), - buffer: self.data.0.buffer, - } - .into(), - value_range: None, - } + /// If the wrong number of names are given, a warning will be logged, + /// and the names might not show up correctly. + pub fn with_dim_names( + mut self, + names: impl IntoIterator>, + ) -> Self { + self.data.0 = self.data.0.with_dim_names(names); + self } } diff --git a/crates/store/re_types/src/datatypes/.gitattributes b/crates/store/re_types/src/datatypes/.gitattributes index 289cbd45793c..5995b6d6c716 100644 --- a/crates/store/re_types/src/datatypes/.gitattributes +++ b/crates/store/re_types/src/datatypes/.gitattributes @@ -25,7 +25,6 @@ rgba32.rs linguist-generated=true rotation_axis_angle.rs linguist-generated=true tensor_buffer.rs linguist-generated=true tensor_data.rs linguist-generated=true -tensor_dimension.rs linguist-generated=true tensor_dimension_index_selection.rs linguist-generated=true tensor_dimension_selection.rs linguist-generated=true utf8pair.rs linguist-generated=true diff --git a/crates/store/re_types/src/datatypes/mod.rs b/crates/store/re_types/src/datatypes/mod.rs index d1edf377eb08..f18d728fd794 100644 --- a/crates/store/re_types/src/datatypes/mod.rs +++ b/crates/store/re_types/src/datatypes/mod.rs @@ -46,8 +46,6 @@ mod tensor_buffer; mod tensor_buffer_ext; mod tensor_data; mod tensor_data_ext; -mod tensor_dimension; -mod tensor_dimension_ext; mod tensor_dimension_index_selection; mod tensor_dimension_selection; mod tensor_dimension_selection_ext; @@ -95,7 +93,6 @@ pub use self::rgba32::Rgba32; pub use self::rotation_axis_angle::RotationAxisAngle; pub use self::tensor_buffer::TensorBuffer; pub use self::tensor_data::TensorData; -pub use self::tensor_dimension::TensorDimension; pub use self::tensor_dimension_index_selection::TensorDimensionIndexSelection; pub use self::tensor_dimension_selection::TensorDimensionSelection; pub use self::utf8pair::Utf8Pair; diff --git a/crates/store/re_types/src/datatypes/tensor_data.rs b/crates/store/re_types/src/datatypes/tensor_data.rs index 0d19cb6190a6..4d75cc0c12e3 100644 --- a/crates/store/re_types/src/datatypes/tensor_data.rs +++ b/crates/store/re_types/src/datatypes/tensor_data.rs @@ -28,8 +28,17 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// which stores a contiguous array of typed values. #[derive(Clone, Debug, PartialEq)] pub struct TensorData { - /// The shape of the tensor, including optional names for each dimension. - pub shape: Vec, + /// The shape of the tensor, i.e. the length of each dimension. + pub shape: ::re_types_core::ArrowBuffer, + + /// The names of the dimensions of the tensor (optional). + /// + /// If set, should be the same length as [`datatypes::TensorData::shape`][crate::datatypes::TensorData::shape]. + /// If it has a different length your names may show up improperly, + /// and some constructors may produce a warning or even an error. + /// + /// Example: `["height", "width", "channel", "batch"]`. + pub names: Option>, /// The content/data. pub buffer: crate::datatypes::TensorBuffer, @@ -47,11 +56,20 @@ impl ::re_types_core::Loggable for TensorData { "shape", DataType::List(std::sync::Arc::new(Field::new( "item", - ::arrow_datatype(), + DataType::UInt64, false, ))), false, ), + Field::new( + "names", + DataType::List(std::sync::Arc::new(Field::new( + "item", + DataType::Utf8, + false, + ))), + true, + ), Field::new( "buffer", ::arrow_datatype(), @@ -76,11 +94,20 @@ impl ::re_types_core::Loggable for TensorData { "shape", DataType::List(std::sync::Arc::new(Field::new( "item", - ::arrow_datatype(), + DataType::UInt64, false, ))), false, ), + Field::new( + "names", + DataType::List(std::sync::Arc::new(Field::new( + "item", + DataType::Utf8, + false, + ))), + true, + ), Field::new( "buffer", ::arrow_datatype(), @@ -113,29 +140,73 @@ impl ::re_types_core::Loggable for TensorData { let any_nones = somes.iter().any(|some| !*some); any_nones.then(|| somes.into()) }; + { + let offsets = + arrow::buffer::OffsetBuffer::::from_lengths(shape.iter().map( + |opt| opt.as_ref().map_or(0, |datum| datum.num_instances()), + )); + let shape_inner_data: ScalarBuffer<_> = shape + .iter() + .flatten() + .map(|b| b.as_slice()) + .collect::>() + .concat() + .into(); + let shape_inner_validity: Option = None; + as_array_ref(ListArray::try_new( + std::sync::Arc::new(Field::new("item", DataType::UInt64, false)), + offsets, + as_array_ref(PrimitiveArray::::new( + shape_inner_data, + shape_inner_validity, + )), + shape_validity, + )?) + } + }, + { + let (somes, names): (Vec<_>, Vec<_>) = data + .iter() + .map(|datum| { + let datum = + datum.as_ref().map(|datum| datum.names.clone()).flatten(); + (datum.is_some(), datum) + }) + .unzip(); + let names_validity: Option = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; { let offsets = arrow::buffer::OffsetBuffer::::from_lengths( - shape + names .iter() .map(|opt| opt.as_ref().map_or(0, |datum| datum.len())), ); - let shape_inner_data: Vec<_> = - shape.into_iter().flatten().flatten().collect(); - let shape_inner_validity: Option = None; + let names_inner_data: Vec<_> = + names.into_iter().flatten().flatten().collect(); + let names_inner_validity: Option = None; as_array_ref(ListArray::try_new( - std::sync::Arc::new(Field::new( - "item", - ::arrow_datatype(), - false, - )), + std::sync::Arc::new(Field::new("item", DataType::Utf8, false)), offsets, { - _ = shape_inner_validity; - crate::datatypes::TensorDimension::to_arrow_opt( - shape_inner_data.into_iter().map(Some), - )? + let offsets = arrow::buffer::OffsetBuffer::::from_lengths( + names_inner_data.iter().map(|datum| datum.len()), + ); + let inner_data: arrow::buffer::Buffer = names_inner_data + .into_iter() + .flat_map(|s| s.into_arrow2_buffer()) + .collect(); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + as_array_ref(unsafe { + StringArray::new_unchecked( + offsets, + inner_data, + names_inner_validity, + ) + }) }, - shape_validity, + names_validity, )?) } }, @@ -208,7 +279,7 @@ impl ::re_types_core::Loggable for TensorData { .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", - ::arrow_datatype(), + DataType::UInt64, false, ))); let actual = arrow_data.data_type().clone(); @@ -220,10 +291,133 @@ impl ::re_types_core::Loggable for TensorData { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::datatypes::TensorDimension::from_arrow2_opt(arrow_data_inner) + arrow_data_inner + .as_any() + .downcast_ref::() + .ok_or_else(|| { + let expected = DataType::UInt64; + let actual = arrow_data_inner.data_type().clone(); + DeserializationError::datatype_mismatch(expected, actual) + }) .with_context("rerun.datatypes.TensorData#shape")? + .values() + }; + let offsets = arrow_data.offsets(); + arrow2::bitmap::utils::ZipValidity::new_with_validity( + offsets.windows(2), + arrow_data.validity(), + ) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } + + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { + arrow_data_inner + .clone() + .sliced_unchecked(start, end - start) + }; + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() + }) + .collect::>>>()? + } + .into_iter() + } + }; + let names = { + if !arrays_by_name.contains_key("names") { + return Err(DeserializationError::missing_struct_field( + Self::arrow_datatype(), + "names", + )) + .with_context("rerun.datatypes.TensorData"); + } + let arrow_data = &**arrays_by_name["names"]; + { + let arrow_data = arrow_data + .as_any() + .downcast_ref::>() + .ok_or_else(|| { + let expected = DataType::List(std::sync::Arc::new(Field::new( + "item", + DataType::Utf8, + false, + ))); + let actual = arrow_data.data_type().clone(); + DeserializationError::datatype_mismatch(expected, actual) + }) + .with_context("rerun.datatypes.TensorData#names")?; + if arrow_data.is_empty() { + Vec::new() + } else { + let arrow_data_inner = { + let arrow_data_inner = &**arrow_data.values(); + { + let arrow_data_inner = arrow_data_inner + .as_any() + .downcast_ref::>() + .ok_or_else(|| { + let expected = DataType::Utf8; + let actual = arrow_data_inner.data_type().clone(); + DeserializationError::datatype_mismatch( + expected, actual, + ) + }) + .with_context("rerun.datatypes.TensorData#names")?; + let arrow_data_inner_buf = arrow_data_inner.values(); + let offsets = arrow_data_inner.offsets(); + arrow2::bitmap::utils::ZipValidity::new_with_validity( + offsets.windows(2), + arrow_data_inner.validity(), + ) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_inner_buf.len() < end { + return Err( + DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_buf.len(), + ), + ); + } + + #[allow( + unsafe_code, + clippy::undocumented_unsafe_blocks + )] + let data = unsafe { + arrow_data_inner_buf + .clone() + .sliced_unchecked(start, len) + }; + Ok(data) + }) + .transpose() + }) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt + .map(|v| ::re_types_core::ArrowString::from(v)) + }) + }) + .collect::>>>() + .with_context("rerun.datatypes.TensorData#names")? .into_iter() - .collect::>() + } + .collect::>() }; let offsets = arrow_data.offsets(); arrow2::bitmap::utils::ZipValidity::new_with_validity( @@ -272,15 +466,16 @@ impl ::re_types_core::Loggable for TensorData { .into_iter() }; arrow2::bitmap::utils::ZipValidity::new_with_validity( - ::itertools::izip!(shape, buffer), + ::itertools::izip!(shape, names, buffer), arrow_data.validity(), ) .map(|opt| { - opt.map(|(shape, buffer)| { + opt.map(|(shape, names, buffer)| { Ok(Self { shape: shape .ok_or_else(DeserializationError::missing_data) .with_context("rerun.datatypes.TensorData#shape")?, + names, buffer: buffer .ok_or_else(DeserializationError::missing_data) .with_context("rerun.datatypes.TensorData#buffer")?, @@ -298,12 +493,13 @@ impl ::re_types_core::Loggable for TensorData { impl ::re_types_core::SizeBytes for TensorData { #[inline] fn heap_size_bytes(&self) -> u64 { - self.shape.heap_size_bytes() + self.buffer.heap_size_bytes() + self.shape.heap_size_bytes() + self.names.heap_size_bytes() + self.buffer.heap_size_bytes() } #[inline] fn is_pod() -> bool { - >::is_pod() + <::re_types_core::ArrowBuffer>::is_pod() + && >>::is_pod() && ::is_pod() } } diff --git a/crates/store/re_types/src/datatypes/tensor_data_ext.rs b/crates/store/re_types/src/datatypes/tensor_data_ext.rs index bca0ddde0c2d..537368d08ace 100644 --- a/crates/store/re_types/src/datatypes/tensor_data_ext.rs +++ b/crates/store/re_types/src/datatypes/tensor_data_ext.rs @@ -1,3 +1,5 @@ +use re_types_core::{ArrowBuffer, ArrowString}; + use crate::tensor_data::{TensorCastError, TensorDataType, TensorElement}; #[cfg(feature = "image")] @@ -6,33 +8,69 @@ use crate::tensor_data::TensorImageLoadError; #[allow(unused_imports)] // Used for docstring links use crate::archetypes::EncodedImage; -use super::{TensorBuffer, TensorData, TensorDimension}; +use super::{TensorBuffer, TensorData}; // ---------------------------------------------------------------------------- impl TensorData { /// Create a new tensor. #[inline] - pub fn new(shape: Vec, buffer: TensorBuffer) -> Self { - Self { shape, buffer } + pub fn new(shape: impl Into>, buffer: TensorBuffer) -> Self { + Self { + shape: shape.into(), + names: None, + buffer, + } } - /// The shape of the tensor, including optional dimension names. + /// Set the names of the dimensions to the provided names. + /// + /// Any existing names will be overwritten. + /// + /// If the wrong number of names are given, a warning will be logged, + /// and the names might not show up correctly. + pub fn with_dim_names( + mut self, + names: impl IntoIterator>, + ) -> Self { + let names: Vec = names.into_iter().map(|x| x.into()).collect(); + + if names.len() != self.shape.len() { + re_log::warn_once!( + "Wrong number of names provided for tensor dimension. {} provided but {} expected. The names will be ignored.", + names.len(), + self.shape.len(), + ); + } + + self.names = Some(names); + + self + } + + /// The shape of the tensor. #[inline] - pub fn shape(&self) -> &[TensorDimension] { + pub fn shape(&self) -> &[u64] { self.shape.as_slice() } + /// Get the name of a specific dimension. + /// + /// Returns `None` if the dimension does not have a name. + pub fn dim_name(&self, dim: usize) -> Option<&ArrowString> { + self.names.as_ref().and_then(|names| names.get(dim)) + } + /// Returns the shape of the tensor with all leading & trailing dimensions of size 1 ignored. /// /// If all dimension sizes are one, this returns only the first dimension. #[inline] - pub fn shape_short(&self) -> &[TensorDimension] { + pub fn shape_short(&self) -> &[u64] { if self.shape.is_empty() { &self.shape } else { - let first_not_one = self.shape.iter().position(|dim| dim.size != 1); - let last_not_one = self.shape.iter().rev().position(|dim| dim.size != 1); + let first_not_one = self.shape.iter().position(|&dim| dim != 1); + let last_not_one = self.shape.iter().rev().position(|&dim| dim != 1); &self.shape[first_not_one.unwrap_or(0)..self.shape.len() - last_not_one.unwrap_or(0)] } } @@ -53,7 +91,7 @@ impl TensorData { if self.shape.is_empty() { false } else { - self.shape.iter().filter(|dim| dim.size > 1).count() <= 1 + self.shape.iter().filter(|&&dim| dim > 1).count() <= 1 } } @@ -63,12 +101,12 @@ impl TensorData { pub fn get(&self, index: &[u64]) -> Option { let mut stride: usize = 1; let mut offset: usize = 0; - for (TensorDimension { size, .. }, index) in self.shape.iter().zip(index).rev() { + for (&size, &index) in self.shape.iter().zip(index).rev() { if size <= index { return None; } - offset += *index as usize * stride; - stride *= *size as usize; + offset += index as usize * stride; + stride *= size as usize; } match &self.buffer { @@ -103,7 +141,8 @@ impl Default for TensorData { #[inline] fn default() -> Self { Self { - shape: Vec::new(), + shape: Default::default(), + names: None, buffer: TensorBuffer::U8(Vec::new().into()), } } @@ -117,7 +156,7 @@ macro_rules! ndarray_from_tensor { type Error = TensorCastError; fn try_from(value: &'a TensorData) -> Result { - let shape: Vec<_> = value.shape.iter().map(|d| d.size as usize).collect(); + let shape: Vec = value.shape.iter().map(|&d| d as usize).collect(); if let TensorBuffer::$variant(data) = &value.buffer { ndarray::ArrayViewD::from_shape(shape, data.as_slice()) @@ -138,26 +177,17 @@ macro_rules! tensor_from_ndarray { type Error = TensorCastError; fn try_from(view: ::ndarray::ArrayView<'a, $type, D>) -> Result { - let shape = view - .shape() - .iter() - .map(|dim| TensorDimension { - size: *dim as u64, - name: None, - }) - .collect(); + let shape = ArrowBuffer::from_iter(view.shape().iter().map(|&dim| dim as u64)); match view.to_slice() { - Some(slice) => Ok(TensorData { + Some(slice) => Ok(TensorData::new( shape, - buffer: TensorBuffer::$variant(Vec::from(slice).into()), - }), - None => Ok(TensorData { + TensorBuffer::$variant(Vec::from(slice).into()), + )), + None => Ok(TensorData::new( shape, - buffer: TensorBuffer::$variant( - view.iter().cloned().collect::>().into(), - ), - }), + TensorBuffer::$variant(view.iter().cloned().collect::>().into()), + )), } } } @@ -166,14 +196,7 @@ macro_rules! tensor_from_ndarray { type Error = TensorCastError; fn try_from(value: ndarray::Array<$type, D>) -> Result { - let shape = value - .shape() - .iter() - .map(|dim| TensorDimension { - size: *dim as u64, - name: None, - }) - .collect(); + let shape = ArrowBuffer::from_iter(value.shape().iter().map(|&dim| dim as u64)); let vec = if value.is_standard_layout() { let (mut vec, offset) = value.into_raw_vec_and_offset(); @@ -190,28 +213,22 @@ macro_rules! tensor_from_ndarray { value.into_iter().collect::>() }; - Ok(Self { - shape, - buffer: TensorBuffer::$variant(vec.into()), - }) + Ok(Self::new(shape, TensorBuffer::$variant(vec.into()))) } } impl From> for TensorData { fn from(vec: Vec<$type>) -> Self { - TensorData { - shape: vec![TensorDimension::unnamed(vec.len() as u64)], - buffer: TensorBuffer::$variant(vec.into()), - } + Self::new(vec![vec.len() as u64], TensorBuffer::$variant(vec.into())) } } impl From<&[$type]> for TensorData { fn from(slice: &[$type]) -> Self { - TensorData { - shape: vec![TensorDimension::unnamed(slice.len() as u64)], - buffer: TensorBuffer::$variant(slice.into()), - } + Self::new( + vec![slice.len() as u64], + TensorBuffer::$variant(slice.into()), + ) } } }; @@ -247,7 +264,7 @@ impl<'a> TryFrom<&'a TensorData> for ::ndarray::ArrayViewD<'a, u8> { fn try_from(value: &'a TensorData) -> Result { match &value.buffer { TensorBuffer::U8(data) => { - let shape: Vec<_> = value.shape.iter().map(|d| d.size as usize).collect(); + let shape: Vec = value.shape.iter().map(|&d| d as usize).collect(); ndarray::ArrayViewD::from_shape(shape, bytemuck::cast_slice(data.as_slice())) .map_err(|err| TensorCastError::BadTensorShape { source: err }) } @@ -363,19 +380,15 @@ impl TensorData { )); } }; - let shape = if depth == 1 { - vec![ - TensorDimension::height(h as _), - TensorDimension::width(w as _), - ] + let (shape, names) = if depth == 1 { + (vec![h as _, w as _], vec!["height", "width"]) } else { - vec![ - TensorDimension::height(h as _), - TensorDimension::width(w as _), - TensorDimension::depth(depth), - ] + ( + vec![h as _, w as _, depth], + vec!["height", "width", "depth"], + ) }; - Ok(Self { shape, buffer }) + Ok(Self::new(shape, buffer).with_dim_names(names)) } } diff --git a/crates/store/re_types/src/datatypes/tensor_dimension.rs b/crates/store/re_types/src/datatypes/tensor_dimension.rs deleted file mode 100644 index 619c954eea2f..000000000000 --- a/crates/store/re_types/src/datatypes/tensor_dimension.rs +++ /dev/null @@ -1,266 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/rust/api.rs -// Based on "crates/store/re_types/definitions/rerun/datatypes/tensor_dimension.fbs". - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] -#![allow(clippy::map_flatten)] -#![allow(clippy::needless_question_mark)] -#![allow(clippy::new_without_default)] -#![allow(clippy::redundant_closure)] -#![allow(clippy::too_many_arguments)] -#![allow(clippy::too_many_lines)] - -use ::re_types_core::external::arrow2; -use ::re_types_core::SerializationResult; -use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; -use ::re_types_core::{ComponentDescriptor, ComponentName}; -use ::re_types_core::{DeserializationError, DeserializationResult}; - -/// **Datatype**: A single dimension within a multi-dimensional tensor. -#[derive(Clone, Default, Eq, PartialEq)] -pub struct TensorDimension { - /// The length of this dimension. - pub size: u64, - - /// The name of this dimension, e.g. "width", "height", "channel", "batch', …. - pub name: Option<::re_types_core::ArrowString>, -} - -::re_types_core::macros::impl_into_cow!(TensorDimension); - -impl ::re_types_core::Loggable for TensorDimension { - #[inline] - fn arrow_datatype() -> arrow::datatypes::DataType { - #![allow(clippy::wildcard_imports)] - use arrow::datatypes::*; - DataType::Struct(Fields::from(vec![ - Field::new("size", DataType::UInt64, false), - Field::new("name", DataType::Utf8, true), - ])) - } - - fn to_arrow_opt<'a>( - data: impl IntoIterator>>>, - ) -> SerializationResult - where - Self: Clone + 'a, - { - #![allow(clippy::wildcard_imports)] - #![allow(clippy::manual_is_variant_and)] - use ::re_types_core::{arrow_helpers::as_array_ref, Loggable as _, ResultExt as _}; - use arrow::{array::*, buffer::*, datatypes::*}; - Ok({ - let fields = Fields::from(vec![ - Field::new("size", DataType::UInt64, false), - Field::new("name", DataType::Utf8, true), - ]); - let (somes, data): (Vec<_>, Vec<_>) = data - .into_iter() - .map(|datum| { - let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - (datum.is_some(), datum) - }) - .unzip(); - let validity: Option = { - let any_nones = somes.iter().any(|some| !*some); - any_nones.then(|| somes.into()) - }; - as_array_ref(StructArray::new( - fields, - vec![ - { - let (somes, size): (Vec<_>, Vec<_>) = data - .iter() - .map(|datum| { - let datum = datum.as_ref().map(|datum| datum.size.clone()); - (datum.is_some(), datum) - }) - .unzip(); - let size_validity: Option = { - let any_nones = somes.iter().any(|some| !*some); - any_nones.then(|| somes.into()) - }; - as_array_ref(PrimitiveArray::::new( - ScalarBuffer::from( - size.into_iter() - .map(|v| v.unwrap_or_default()) - .collect::>(), - ), - size_validity, - )) - }, - { - let (somes, name): (Vec<_>, Vec<_>) = data - .iter() - .map(|datum| { - let datum = - datum.as_ref().map(|datum| datum.name.clone()).flatten(); - (datum.is_some(), datum) - }) - .unzip(); - let name_validity: Option = { - let any_nones = somes.iter().any(|some| !*some); - any_nones.then(|| somes.into()) - }; - { - let offsets = - arrow::buffer::OffsetBuffer::::from_lengths(name.iter().map( - |opt| opt.as_ref().map(|datum| datum.len()).unwrap_or_default(), - )); - let inner_data: arrow::buffer::Buffer = name - .into_iter() - .flatten() - .flat_map(|s| s.into_arrow2_buffer()) - .collect(); - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - as_array_ref(unsafe { - StringArray::new_unchecked(offsets, inner_data, name_validity) - }) - } - }, - ], - validity, - )) - }) - } - - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, - ) -> DeserializationResult>> - where - Self: Sized, - { - #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - Ok({ - let arrow_data = arrow_data - .as_any() - .downcast_ref::() - .ok_or_else(|| { - let expected = Self::arrow_datatype(); - let actual = arrow_data.data_type().clone(); - DeserializationError::datatype_mismatch(expected, actual) - }) - .with_context("rerun.datatypes.TensorDimension")?; - if arrow_data.is_empty() { - Vec::new() - } else { - let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields - .iter() - .map(|field| field.name.as_str()) - .zip(arrow_data_arrays) - .collect(); - let size = { - if !arrays_by_name.contains_key("size") { - return Err(DeserializationError::missing_struct_field( - Self::arrow_datatype(), - "size", - )) - .with_context("rerun.datatypes.TensorDimension"); - } - let arrow_data = &**arrays_by_name["size"]; - arrow_data - .as_any() - .downcast_ref::() - .ok_or_else(|| { - let expected = DataType::UInt64; - let actual = arrow_data.data_type().clone(); - DeserializationError::datatype_mismatch(expected, actual) - }) - .with_context("rerun.datatypes.TensorDimension#size")? - .into_iter() - .map(|opt| opt.copied()) - }; - let name = { - if !arrays_by_name.contains_key("name") { - return Err(DeserializationError::missing_struct_field( - Self::arrow_datatype(), - "name", - )) - .with_context("rerun.datatypes.TensorDimension"); - } - let arrow_data = &**arrays_by_name["name"]; - { - let arrow_data = arrow_data - .as_any() - .downcast_ref::>() - .ok_or_else(|| { - let expected = DataType::Utf8; - let actual = arrow_data.data_type().clone(); - DeserializationError::datatype_mismatch(expected, actual) - }) - .with_context("rerun.datatypes.TensorDimension#name")?; - let arrow_data_buf = arrow_data.values(); - let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } - - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) - }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) - }) - }) - .collect::>>>() - .with_context("rerun.datatypes.TensorDimension#name")? - .into_iter() - } - }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - ::itertools::izip!(size, name), - arrow_data.validity(), - ) - .map(|opt| { - opt.map(|(size, name)| { - Ok(Self { - size: size - .ok_or_else(DeserializationError::missing_data) - .with_context("rerun.datatypes.TensorDimension#size")?, - name, - }) - }) - .transpose() - }) - .collect::>>() - .with_context("rerun.datatypes.TensorDimension")? - } - }) - } -} - -impl ::re_types_core::SizeBytes for TensorDimension { - #[inline] - fn heap_size_bytes(&self) -> u64 { - self.size.heap_size_bytes() + self.name.heap_size_bytes() - } - - #[inline] - fn is_pod() -> bool { - ::is_pod() && >::is_pod() - } -} diff --git a/crates/store/re_types/src/datatypes/tensor_dimension_ext.rs b/crates/store/re_types/src/datatypes/tensor_dimension_ext.rs deleted file mode 100644 index 8f50ab11ecd9..000000000000 --- a/crates/store/re_types/src/datatypes/tensor_dimension_ext.rs +++ /dev/null @@ -1,60 +0,0 @@ -use super::TensorDimension; - -impl TensorDimension { - const DEFAULT_NAME_WIDTH: &'static str = "width"; - const DEFAULT_NAME_HEIGHT: &'static str = "height"; - const DEFAULT_NAME_DEPTH: &'static str = "depth"; - - /// Create a new dimension with a given size, and the name "height". - #[inline] - pub fn height(size: u64) -> Self { - Self::named(size, String::from(Self::DEFAULT_NAME_HEIGHT)) - } - - /// Create a new dimension with a given size, and the name "width". - #[inline] - pub fn width(size: u64) -> Self { - Self::named(size, String::from(Self::DEFAULT_NAME_WIDTH)) - } - - /// Create a new dimension with a given size, and the name "depth". - #[inline] - pub fn depth(size: u64) -> Self { - Self::named(size, String::from(Self::DEFAULT_NAME_DEPTH)) - } - - /// Create a named dimension. - #[inline] - pub fn named(size: u64, name: impl Into) -> Self { - Self { - size, - name: Some(name.into()), - } - } - - /// Create an unnamed dimension. - #[inline] - pub fn unnamed(size: u64) -> Self { - Self { size, name: None } - } -} - -impl std::fmt::Debug for TensorDimension { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - if let Some(name) = &self.name { - write!(f, "{}={}", name, self.size) - } else { - self.size.fmt(f) - } - } -} - -impl std::fmt::Display for TensorDimension { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - if let Some(name) = &self.name { - write!(f, "{}={}", name, self.size) - } else { - self.size.fmt(f) - } - } -} diff --git a/crates/store/re_types/src/image.rs b/crates/store/re_types/src/image.rs index 75e13f6f1e16..1041f07ff38b 100644 --- a/crates/store/re_types/src/image.rs +++ b/crates/store/re_types/src/image.rs @@ -1,10 +1,11 @@ //! Image-related utilities. +use re_types_core::ArrowBuffer; use smallvec::{smallvec, SmallVec}; use crate::{ datatypes::ChannelDatatype, - datatypes::{Blob, TensorBuffer, TensorData, TensorDimension}, + datatypes::{Blob, TensorBuffer, TensorData}, }; // ---------------------------------------------------------------------------- @@ -95,7 +96,7 @@ where /// The tensor did not have the right shape for an image (e.g. had too many dimensions). #[error("Could not create Image from TensorData with shape {0:?}")] - BadImageShape(Vec), + BadImageShape(ArrowBuffer), /// Happens if you try to cast `NV12` or `YUY2` to a depth image or segmentation image. #[error("Chroma downsampling is not supported for this image type (e.g. DepthImage or SegmentationImage)")] @@ -181,7 +182,7 @@ impl ImageChannelType for f64 { /// /// For instance: `[1, 480, 640, 3, 1]` would return `[1, 2, 3]`, /// the indices of the `[480, 640, 3]` dimensions. -pub fn find_non_empty_dim_indices(shape: &[TensorDimension]) -> SmallVec<[usize; 4]> { +pub fn find_non_empty_dim_indices(shape: &[u64]) -> SmallVec<[usize; 4]> { match shape.len() { 0 => return smallvec![], 1 => return smallvec![0], @@ -197,7 +198,7 @@ pub fn find_non_empty_dim_indices(shape: &[TensorDimension]) -> SmallVec<[usize; shape .iter() .enumerate() - .filter_map(|(ind, dim)| if dim.size != 1 { Some(ind) } else { None }); + .filter_map(|(ind, &dim)| if dim != 1 { Some(ind) } else { None }); // 0 is always a valid index. let mut min = non_unit_indices.next().unwrap_or(0); @@ -216,7 +217,7 @@ pub fn find_non_empty_dim_indices(shape: &[TensorDimension]) -> SmallVec<[usize; // Grow up to 3 if the inner dimension is already 3 or 4 (Color Images) // Otherwise, only grow up to 2. // (1x1x3) -> 1x1x3 rgb rather than 1x3 mono - let target_len = match shape[max].size { + let target_len = match shape[max] { 3 | 4 => 3, _ => 2, }; @@ -231,14 +232,7 @@ pub fn find_non_empty_dim_indices(shape: &[TensorDimension]) -> SmallVec<[usize; #[test] fn test_find_non_empty_dim_indices() { fn expect(shape: &[u64], expected: &[usize]) { - let dim: Vec<_> = shape - .iter() - .map(|s| TensorDimension { - size: *s, - name: None, - }) - .collect(); - let got = find_non_empty_dim_indices(&dim); + let got = find_non_empty_dim_indices(shape); assert!( got.as_slice() == expected, "Input: {shape:?}, got {got:?}, expected {expected:?}" diff --git a/crates/store/re_types/src/reflection/mod.rs b/crates/store/re_types/src/reflection/mod.rs index 05839fe7c80e..cd1537ad937b 100644 --- a/crates/store/re_types/src/reflection/mod.rs +++ b/crates/store/re_types/src/reflection/mod.rs @@ -1413,11 +1413,11 @@ fn generate_archetype_reflection() -> ArchetypeReflectionMap { fields: vec![ ArchetypeFieldReflection { name : "edges", display_name : "Edges", component_name : "rerun.components.GraphEdge".into(), docstring_md : - "A list of node tuples.\n\n⚠\u{fe0f} **This type is experimental and may be removed in future versions**", - is_required : true, }, ArchetypeFieldReflection { name : - "graph_type", display_name : "Graph type", component_name : - "rerun.components.GraphType".into(), docstring_md : - "Specifies if the graph is directed or undirected.\n\nIf no [`components.GraphType`](https://rerun.io/docs/reference/types/components/graph_type?speculative-link) is provided, the graph is assumed to be undirected.\n\n⚠\u{fe0f} **This type is experimental and may be removed in future versions**", + "A list of node tuples.", is_required : true, }, + ArchetypeFieldReflection { name : "graph_type", display_name : + "Graph type", component_name : "rerun.components.GraphType".into(), + docstring_md : + "Specifies if the graph is directed or undirected.\n\nIf no [`components.GraphType`](https://rerun.io/docs/reference/types/components/graph_type) is provided, the graph is assumed to be undirected.", is_required : false, }, ], }, @@ -1431,29 +1431,24 @@ fn generate_archetype_reflection() -> ArchetypeReflectionMap { fields: vec![ ArchetypeFieldReflection { name : "node_ids", display_name : "Node ids", component_name : "rerun.components.GraphNode".into(), - docstring_md : - "A list of node IDs.\n\n⚠\u{fe0f} **This type is experimental and may be removed in future versions**", - is_required : true, }, ArchetypeFieldReflection { name : "positions", - display_name : "Positions", component_name : - "rerun.components.Position2D".into(), docstring_md : - "Optional center positions of the nodes.\n\n⚠\u{fe0f} **This type is experimental and may be removed in future versions**", - is_required : false, }, ArchetypeFieldReflection { name : "colors", - display_name : "Colors", component_name : "rerun.components.Color" - .into(), docstring_md : - "Optional colors for the boxes.\n\n⚠\u{fe0f} **This type is experimental and may be removed in future versions**", - is_required : false, }, ArchetypeFieldReflection { name : "labels", - display_name : "Labels", component_name : "rerun.components.Text" - .into(), docstring_md : - "Optional text labels for the node.\n\n⚠\u{fe0f} **This type is experimental and may be removed in future versions**", - is_required : false, }, ArchetypeFieldReflection { name : - "show_labels", display_name : "Show labels", component_name : + docstring_md : "A list of node IDs.", is_required : true, }, + ArchetypeFieldReflection { name : "positions", display_name : + "Positions", component_name : "rerun.components.Position2D".into(), + docstring_md : "Optional center positions of the nodes.", is_required + : false, }, ArchetypeFieldReflection { name : "colors", display_name + : "Colors", component_name : "rerun.components.Color".into(), + docstring_md : "Optional colors for the boxes.", is_required : false, + }, ArchetypeFieldReflection { name : "labels", display_name : + "Labels", component_name : "rerun.components.Text".into(), + docstring_md : "Optional text labels for the node.", is_required : + false, }, ArchetypeFieldReflection { name : "show_labels", + display_name : "Show labels", component_name : "rerun.components.ShowLabels".into(), docstring_md : - "Optional choice of whether the text labels should be shown by default.\n\n⚠\u{fe0f} **This type is experimental and may be removed in future versions**", + "Optional choice of whether the text labels should be shown by default.", is_required : false, }, ArchetypeFieldReflection { name : "radii", display_name : "Radii", component_name : "rerun.components.Radius" - .into(), docstring_md : - "Optional radii for nodes.\n\n⚠\u{fe0f} **This type is experimental and may be removed in future versions**", - is_required : false, }, + .into(), docstring_md : "Optional radii for nodes.", is_required : + false, }, ], }, ), diff --git a/crates/store/re_types/tests/types/tensor.rs b/crates/store/re_types/tests/types/tensor.rs index 3474ae7b1d35..2fb8a132217a 100644 --- a/crates/store/re_types/tests/types/tensor.rs +++ b/crates/store/re_types/tests/types/tensor.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use re_types::{ archetypes::Tensor, - datatypes::{TensorBuffer, TensorData, TensorDimension}, + datatypes::{TensorBuffer, TensorData}, tensor_data::TensorCastError, Archetype as _, AsComponents as _, }; @@ -12,20 +12,7 @@ use crate::util; #[test] fn tensor_roundtrip() { let all_expected = [Tensor { - data: TensorData { - shape: vec![ - TensorDimension { - size: 2, - name: None, - }, - TensorDimension { - size: 3, - name: None, - }, - ], - buffer: TensorBuffer::U8(vec![1, 2, 3, 4, 5, 6].into()), - } - .into(), + data: TensorData::new(vec![2, 3], TensorBuffer::U8(vec![1, 2, 3, 4, 5, 6].into())).into(), value_range: None, }]; @@ -60,14 +47,7 @@ fn tensor_roundtrip() { #[test] fn convert_tensor_to_ndarray_u8() { - let t = TensorData::new( - vec![ - TensorDimension::unnamed(3), - TensorDimension::unnamed(4), - TensorDimension::unnamed(5), - ], - TensorBuffer::U8(vec![0; 60].into()), - ); + let t = TensorData::new(vec![3, 4, 5], TensorBuffer::U8(vec![0; 60].into())); let n = ndarray::ArrayViewD::::try_from(&t).unwrap(); @@ -76,14 +56,7 @@ fn convert_tensor_to_ndarray_u8() { #[test] fn convert_tensor_to_ndarray_u16() { - let t = TensorData::new( - vec![ - TensorDimension::unnamed(3), - TensorDimension::unnamed(4), - TensorDimension::unnamed(5), - ], - TensorBuffer::U16(vec![0_u16; 60].into()), - ); + let t = TensorData::new(vec![3, 4, 5], TensorBuffer::U16(vec![0_u16; 60].into())); let n = ndarray::ArrayViewD::::try_from(&t).unwrap(); @@ -92,14 +65,7 @@ fn convert_tensor_to_ndarray_u16() { #[test] fn convert_tensor_to_ndarray_f32() { - let t = TensorData::new( - vec![ - TensorDimension::unnamed(3), - TensorDimension::unnamed(4), - TensorDimension::unnamed(5), - ], - TensorBuffer::F32(vec![0_f32; 60].into()), - ); + let t = TensorData::new(vec![3, 4, 5], TensorBuffer::F32(vec![0_f32; 60].into())); let n = ndarray::ArrayViewD::::try_from(&t).unwrap(); @@ -111,10 +77,7 @@ fn convert_ndarray_f64_to_tensor() { let n = ndarray::array![[1., 2., 3.], [4., 5., 6.]]; let t = TensorData::try_from(n).unwrap(); - assert_eq!( - t.shape(), - &[TensorDimension::unnamed(2), TensorDimension::unnamed(3)] - ); + assert_eq!(t.shape(), &[2, 3]); } #[test] @@ -123,7 +86,7 @@ fn convert_ndarray_slice_to_tensor() { let n = &n.slice(ndarray::s![.., 1]); let t = TensorData::try_from(*n).unwrap(); - assert_eq!(t.shape(), &[TensorDimension::unnamed(2)]); + assert_eq!(t.shape(), &[2]); } #[test] @@ -220,11 +183,7 @@ fn convert_ndarray_to_tensor_both_layouts_nonzero_offset() { #[test] fn check_slices() { let t = TensorData::new( - vec![ - TensorDimension::unnamed(3), - TensorDimension::unnamed(4), - TensorDimension::unnamed(5), - ], + vec![3, 4, 5], TensorBuffer::U16((0_u16..60).collect::>().into()), ); @@ -258,14 +217,7 @@ fn check_slices() { #[test] fn check_tensor_shape_error() { - let t = TensorData::new( - vec![ - TensorDimension::unnamed(3), - TensorDimension::unnamed(4), - TensorDimension::unnamed(5), - ], - TensorBuffer::U8(vec![0; 59].into()), - ); + let t = TensorData::new(vec![3, 4, 5], TensorBuffer::U8(vec![0; 59].into())); let n = ndarray::ArrayViewD::::try_from(&t); @@ -279,14 +231,7 @@ fn check_tensor_shape_error() { #[test] fn check_tensor_type_error() { - let t = TensorData::new( - vec![ - TensorDimension::unnamed(3), - TensorDimension::unnamed(4), - TensorDimension::unnamed(5), - ], - TensorBuffer::U16(vec![0; 60].into()), - ); + let t = TensorData::new(vec![3, 4, 5], TensorBuffer::U16(vec![0; 60].into())); let n = ndarray::ArrayViewD::::try_from(&t); diff --git a/crates/store/re_types_core/src/arrow_buffer.rs b/crates/store/re_types_core/src/arrow_buffer.rs index a8ed54e38d8d..a07e47ca2e88 100644 --- a/crates/store/re_types_core/src/arrow_buffer.rs +++ b/crates/store/re_types_core/src/arrow_buffer.rs @@ -133,6 +133,16 @@ impl FromIterator for ArrowBuffer { } } +impl<'a, T: ArrowNativeType> IntoIterator for &'a ArrowBuffer { + type Item = &'a T; + type IntoIter = std::slice::Iter<'a, T>; + + #[inline] + fn into_iter(self) -> Self::IntoIter { + self.as_slice().iter() + } +} + impl std::ops::Deref for ArrowBuffer { type Target = [T]; diff --git a/crates/top/rerun/src/commands/rrd/compare.rs b/crates/top/rerun/src/commands/rrd/compare.rs index 3472eacd8f90..c9c7c4778e4d 100644 --- a/crates/top/rerun/src/commands/rrd/compare.rs +++ b/crates/top/rerun/src/commands/rrd/compare.rs @@ -30,6 +30,8 @@ impl CompareCommand { full_dump, } = self; + re_log::debug!("Comparing {path_to_rrd1:?} to {path_to_rrd2:?}…"); + let path_to_rrd1 = PathBuf::from(path_to_rrd1); let path_to_rrd2 = PathBuf::from(path_to_rrd2); @@ -75,6 +77,8 @@ impl CompareCommand { ); } + re_log::debug!("{path_to_rrd1:?} and {path_to_rrd2:?} are similar enough."); + Ok(()) } } diff --git a/crates/top/rerun/src/lib.rs b/crates/top/rerun/src/lib.rs index c96f194d11a6..3386ccc73ddc 100644 --- a/crates/top/rerun/src/lib.rs +++ b/crates/top/rerun/src/lib.rs @@ -169,10 +169,10 @@ pub const EXTERNAL_DATA_LOADER_INCOMPATIBLE_EXIT_CODE: i32 = 66; pub mod external { pub use anyhow; - pub use re_build_info; - pub use re_entity_db; - pub use re_entity_db::external::*; - pub use re_format; + pub use ::re_build_info; + pub use ::re_entity_db; + pub use ::re_entity_db::external::*; + pub use ::re_format; #[cfg(feature = "run")] pub use re_data_source; diff --git a/crates/top/rerun/src/sdk.rs b/crates/top/rerun/src/sdk.rs index 4d8c70a28931..3eab417ce267 100644 --- a/crates/top/rerun/src/sdk.rs +++ b/crates/top/rerun/src/sdk.rs @@ -31,7 +31,7 @@ mod prelude { pub use re_types::datatypes::{ Angle, AnnotationInfo, ChannelDatatype, ClassDescription, ColorModel, Float32, KeypointPair, Mat3x3, PixelFormat, Quaternion, Rgba32, RotationAxisAngle, TensorBuffer, - TensorData, TensorDimension, Vec2D, Vec3D, Vec4D, + TensorData, Vec2D, Vec3D, Vec4D, }; } pub use prelude::*; diff --git a/crates/utils/re_capabilities/README.md b/crates/utils/re_capabilities/README.md index c61326593afe..0388f986f3b5 100644 --- a/crates/utils/re_capabilities/README.md +++ b/crates/utils/re_capabilities/README.md @@ -3,7 +3,7 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. [![Latest version](https://img.shields.io/crates/v/re_capabilities.svg)](https://crates.io/crates/re_capabilitiescrates/utils/) -[![Documentation](https://docs.rs/re_capabilities/badge.svg?speculative-link)](https://docs.rs/re_capabilities?speculative-link) +[![Documentation](https://docs.rs/re_capabilities/badge.svg)](https://docs.rs/re_capabilities) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_data_ui/src/tensor.rs b/crates/viewer/re_data_ui/src/tensor.rs index afe680f47228..8d21b1c1d45c 100644 --- a/crates/viewer/re_data_ui/src/tensor.rs +++ b/crates/viewer/re_data_ui/src/tensor.rs @@ -2,41 +2,34 @@ use itertools::Itertools as _; use re_chunk_store::RowId; use re_log_types::EntityPath; -use re_types::datatypes::{TensorData, TensorDimension}; +use re_types::datatypes::TensorData; use re_ui::UiExt as _; use re_viewer_context::{TensorStats, TensorStatsCache, UiLayout, ViewerContext}; use super::EntityDataUi; -pub fn format_tensor_shape_single_line(shape: &[TensorDimension]) -> String { - const MAX_SHOWN: usize = 4; // should be enough for width/height/depth and then some! - let iter = shape.iter().take(MAX_SHOWN); - let labelled = iter.clone().any(|dim| dim.name.is_some()); - let shapes = iter - .map(|dim| { +fn format_tensor_shape_single_line(tensor: &TensorData) -> String { + let has_names = tensor + .shape + .iter() + .enumerate() + .any(|(dim_idx, _)| tensor.dim_name(dim_idx).is_some()); + tensor + .shape + .iter() + .enumerate() + .map(|(dim_idx, dim_len)| { format!( "{}{}", - dim.size, - if let Some(name) = &dim.name { + dim_len, + if let Some(name) = tensor.dim_name(dim_idx) { format!(" ({name})") } else { String::new() } ) }) - .join(if labelled { " × " } else { "×" }); - format!( - "{shapes}{}", - if shape.len() > MAX_SHOWN { - if labelled { - " × …" - } else { - "×…" - } - } else { - "" - } - ) + .join(if has_names { " × " } else { "×" }) } impl EntityDataUi for re_types::components::TensorData { @@ -75,7 +68,7 @@ pub fn tensor_ui( let text = format!( "{}, {}", tensor.dtype(), - format_tensor_shape_single_line(&tensor.shape) + format_tensor_shape_single_line(tensor) ); ui_layout.label(ui, text).on_hover_ui(|ui| { tensor_summary_ui(ui, tensor, &tensor_stats); @@ -94,7 +87,7 @@ pub fn tensor_summary_ui_grid_contents( tensor: &TensorData, tensor_stats: &TensorStats, ) { - let TensorData { shape, buffer: _ } = tensor; + let TensorData { shape, names, .. } = tensor; ui.grid_left_hand_label("Data type") .on_hover_text("Data type used for all individual elements within the tensor"); @@ -107,12 +100,12 @@ pub fn tensor_summary_ui_grid_contents( // For unnamed tensor dimension more than a single line usually doesn't make sense! // But what if some are named and some are not? // -> If more than 1 is named, make it a column! - if shape.iter().filter(|d| d.name.is_some()).count() > 1 { - for dim in shape { - ui.label(dim.to_string()); + if let Some(names) = names { + for (name, size) in itertools::izip!(names, shape) { + ui.label(format!("{name}={size}")); } } else { - ui.label(format_tensor_shape_single_line(shape)); + ui.label(format_tensor_shape_single_line(tensor)); } }); ui.end_row(); diff --git a/crates/viewer/re_view/README.md b/crates/viewer/re_view/README.md index 54410b016536..4c7f372db337 100644 --- a/crates/viewer/re_view/README.md +++ b/crates/viewer/re_view/README.md @@ -3,7 +3,7 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. [![Latest version](https://img.shields.io/crates/v/re_view.svg)](https://crates.io/crates/re_view) -[![Documentation](https://docs.rs/re_view/badge.svg?speculative-link)](https://docs.rs/re_view?speculative-link) +[![Documentation](https://docs.rs/re_view/badge.svg)](https://docs.rs/re_view) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_view_bar_chart/README.md b/crates/viewer/re_view_bar_chart/README.md index 524f0772e339..b3fc22dc9785 100644 --- a/crates/viewer/re_view_bar_chart/README.md +++ b/crates/viewer/re_view_bar_chart/README.md @@ -3,7 +3,7 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. [![Latest version](https://img.shields.io/crates/v/re_view_bar_chart.svg)](https://crates.io/crates/re_view_bar_chart) -[![Documentation](https://docs.rs/re_view_bar_chart/badge.svg??speculative-link)](https://docs.rs/re_view_bar_chart?speculative-link) +[![Documentation](https://docs.rs/re_view_bar_chart/badge.svg?)](https://docs.rs/re_view_bar_chart) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_view_dataframe/README.md b/crates/viewer/re_view_dataframe/README.md index 23fc1c7eee2f..f08ed1966a56 100644 --- a/crates/viewer/re_view_dataframe/README.md +++ b/crates/viewer/re_view_dataframe/README.md @@ -3,7 +3,7 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. [![Latest version](https://img.shields.io/crates/v/re_view_dataframe.svg)](https://crates.io/crates/re_view_dataframe) -[![Documentation](https://docs.rs/re_view_dataframe/badge.svg?speculative-link)](https://docs.rs/re_view_dataframe?speculative-link) +[![Documentation](https://docs.rs/re_view_dataframe/badge.svg)](https://docs.rs/re_view_dataframe) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_view_graph/README.md b/crates/viewer/re_view_graph/README.md index 3a106e7ad8c3..b64b99770608 100644 --- a/crates/viewer/re_view_graph/README.md +++ b/crates/viewer/re_view_graph/README.md @@ -1,9 +1,9 @@ # re_view_graph -Part of the [`rerun`](https://github.com/rerun-io/rerun?speculative-link) family of crates. +Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_view_graph.svg)](https://crates.io/crates/re_view_graph?speculative-link) -[![Documentation](https://docs.rs/re_view_graph/badge.svg)](https://docs.rs/re_view_graph?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_view_graph.svg)](https://crates.io/crates/re_view_graph) +[![Documentation](https://docs.rs/re_view_graph/badge.svg)](https://docs.rs/re_view_graph) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_view_map/README.md b/crates/viewer/re_view_map/README.md index 5555ab0cf427..e4f2338ed605 100644 --- a/crates/viewer/re_view_map/README.md +++ b/crates/viewer/re_view_map/README.md @@ -2,8 +2,8 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_view_map.svg)](https://crates.io/crates/re_view_spatial?speculative-link) -[![Documentation](https://docs.rs/re_view_map/badge.svg)](https://docs.rs/re_view_spatial?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_view_map.svg)](https://crates.io/crates/re_view_spatial) +[![Documentation](https://docs.rs/re_view_map/badge.svg)](https://docs.rs/re_view_spatial) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_view_spatial/README.md b/crates/viewer/re_view_spatial/README.md index 950c5eb13548..3a23de917b1e 100644 --- a/crates/viewer/re_view_spatial/README.md +++ b/crates/viewer/re_view_spatial/README.md @@ -2,8 +2,8 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_view_spatial.svg)](https://crates.io/crates/re_view_spatial?speculative-link) -[![Documentation](https://docs.rs/re_view_spatial/badge.svg)](https://docs.rs/re_view_spatial?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_view_spatial.svg)](https://crates.io/crates/re_view_spatial) +[![Documentation](https://docs.rs/re_view_spatial/badge.svg)](https://docs.rs/re_view_spatial) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_view_tensor/README.md b/crates/viewer/re_view_tensor/README.md index bd8bab191ee3..c0a325259122 100644 --- a/crates/viewer/re_view_tensor/README.md +++ b/crates/viewer/re_view_tensor/README.md @@ -2,8 +2,8 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_view_tensor.svg)](https://crates.io/crates/re_view_tensor?speculative-link) -[![Documentation](https://docs.rs/re_view_tensor/badge.svg)](https://docs.rs/re_view_tensor?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_view_tensor.svg)](https://crates.io/crates/re_view_tensor) +[![Documentation](https://docs.rs/re_view_tensor/badge.svg)](https://docs.rs/re_view_tensor) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_view_tensor/src/dimension_mapping.rs b/crates/viewer/re_view_tensor/src/dimension_mapping.rs index f3804733b1d8..43ccab9a812b 100644 --- a/crates/viewer/re_view_tensor/src/dimension_mapping.rs +++ b/crates/viewer/re_view_tensor/src/dimension_mapping.rs @@ -1,11 +1,14 @@ use egui::NumExt as _; + use re_types::{ blueprint::{archetypes::TensorSliceSelection, components::TensorDimensionIndexSlider}, components::{TensorDimensionIndexSelection, TensorHeightDimension, TensorWidthDimension}, - datatypes::{TensorDimension, TensorDimensionSelection}, + datatypes::TensorDimensionSelection, }; use re_viewport_blueprint::ViewProperty; +use crate::TensorDimension; + /// Loads slice selection from blueprint and makes modifications (without writing back) such that it is valid /// for the given tensor shape. /// @@ -250,7 +253,7 @@ fn longest_and_second_longest_dim_indices(shape: &[TensorDimension]) -> (usize, #[cfg(test)] mod tests { - use re_types::datatypes::TensorDimension; + use crate::TensorDimension; use re_types::{ blueprint::components::TensorDimensionIndexSlider, components::TensorDimensionIndexSelection, diff --git a/crates/viewer/re_view_tensor/src/lib.rs b/crates/viewer/re_view_tensor/src/lib.rs index 2dda9636b659..19492b29bf34 100644 --- a/crates/viewer/re_view_tensor/src/lib.rs +++ b/crates/viewer/re_view_tensor/src/lib.rs @@ -1,6 +1,6 @@ -//! Rerun tensor View. +//! Rerun tensor view. //! -//! A View dedicated to visualizing tensors with arbitrary dimensionality. +//! A view dedicated to visualizing tensors with arbitrary dimensionality. // TODO(#6330): remove unwrap() #![allow(clippy::unwrap_used)] @@ -12,3 +12,34 @@ mod view_class; mod visualizer_system; pub use view_class::TensorView; + +/// Information about a dimension of a tensor. +struct TensorDimension { + pub size: u64, + pub name: Option, +} + +impl TensorDimension { + pub fn from_tensor_data(tensor_data: &re_types::datatypes::TensorData) -> Vec { + tensor_data + .shape + .iter() + .enumerate() + .map(|(dim_idx, dim_len)| Self { + size: *dim_len, + name: tensor_data.dim_name(dim_idx).cloned(), + }) + .collect() + } + + pub fn unnamed(size: u64) -> Self { + Self { size, name: None } + } + + pub fn named(size: u64, name: impl Into) -> Self { + Self { + size, + name: Some(name.into()), + } + } +} diff --git a/crates/viewer/re_view_tensor/src/tensor_dimension_mapper.rs b/crates/viewer/re_view_tensor/src/tensor_dimension_mapper.rs index ac224320bc12..07e6bed75cb1 100644 --- a/crates/viewer/re_view_tensor/src/tensor_dimension_mapper.rs +++ b/crates/viewer/re_view_tensor/src/tensor_dimension_mapper.rs @@ -1,11 +1,12 @@ use re_types::{ - blueprint::archetypes::TensorSliceSelection, - datatypes::{TensorDimension, TensorDimensionIndexSelection}, + blueprint::archetypes::TensorSliceSelection, datatypes::TensorDimensionIndexSelection, }; use re_ui::UiExt as _; use re_viewer_context::ViewerContext; use re_viewport_blueprint::ViewProperty; +use crate::TensorDimension; + #[derive(Clone, Copy, PartialEq, Eq)] enum DragDropAddress { None, diff --git a/crates/viewer/re_view_tensor/src/tensor_tests.rs b/crates/viewer/re_view_tensor/src/tensor_tests.rs index e8e46712330e..0da7b00c5394 100644 --- a/crates/viewer/re_view_tensor/src/tensor_tests.rs +++ b/crates/viewer/re_view_tensor/src/tensor_tests.rs @@ -1,6 +1,6 @@ #![allow(clippy::unwrap_used)] -use re_types::datatypes::{TensorBuffer, TensorData, TensorDimension}; +use re_types::datatypes::{TensorBuffer, TensorData}; use re_types::tensor_data::TensorCastError; #[test] diff --git a/crates/viewer/re_view_tensor/src/view_class.rs b/crates/viewer/re_view_tensor/src/view_class.rs index 191c327de4fe..0e8165f0101a 100644 --- a/crates/viewer/re_view_tensor/src/view_class.rs +++ b/crates/viewer/re_view_tensor/src/view_class.rs @@ -1,6 +1,5 @@ use egui::{epaint::TextShape, Align2, NumExt as _, Vec2}; use ndarray::Axis; -use re_view::{suggest_view_for_each_entity, view_property_ui}; use re_data_ui::tensor_summary_ui_grid_contents; use re_log_types::EntityPath; @@ -10,10 +9,11 @@ use re_types::{ components::ViewFit, }, components::{Colormap, GammaCorrection, MagnificationFilter, TensorDimensionIndexSelection}, - datatypes::{TensorData, TensorDimension}, + datatypes::TensorData, View, ViewClassIdentifier, }; use re_ui::{list_item, UiExt as _}; +use re_view::{suggest_view_for_each_entity, view_property_ui}; use re_viewer_context::{ gpu_bridge, ApplicableEntities, ColormapWithRange, IdentifiedViewSystem as _, IndicatedEntities, PerVisualizer, TensorStatsCache, TypedComponentFallbackProvider, ViewClass, @@ -26,6 +26,7 @@ use crate::{ dimension_mapping::load_tensor_slice_selection_and_make_valid, tensor_dimension_mapper::dimension_mapping_ui, visualizer_system::{TensorSystem, TensorVisualization}, + TensorDimension, }; #[derive(Default)] @@ -151,12 +152,20 @@ Note: select the view to configure which dimensions are shown." ctx.blueprint_query, view_id, ); - let slice_selection = - load_tensor_slice_selection_and_make_valid(&slice_property, tensor.shape())?; + let slice_selection = load_tensor_slice_selection_and_make_valid( + &slice_property, + &TensorDimension::from_tensor_data(tensor), + )?; ui.separator(); ui.strong("Dimension Mapping"); - dimension_mapping_ui(ctx, ui, tensor.shape(), &slice_selection, &slice_property); + dimension_mapping_ui( + ctx, + ui, + &TensorDimension::from_tensor_data(tensor), + &slice_selection, + &slice_property, + ); // TODO(andreas): this is a bit too inconsistent with the other UIs - we don't offer the same reset/option buttons here if ui @@ -242,8 +251,10 @@ impl TensorView { ctx.blueprint_query, view_id, ); - let slice_selection = - load_tensor_slice_selection_and_make_valid(&slice_property, tensor.shape())?; + let slice_selection = load_tensor_slice_selection_and_make_valid( + &slice_property, + &TensorDimension::from_tensor_data(tensor), + )?; let default_item_spacing = ui.spacing_mut().item_spacing; ui.spacing_mut().item_spacing.y = 0.0; // No extra spacing between sliders and tensor @@ -259,17 +270,26 @@ impl TensorView { } .show(ui, |ui| { ui.spacing_mut().item_spacing = default_item_spacing; // keep the default spacing between sliders - selectors_ui(ctx, ui, tensor.shape(), &slice_selection, &slice_property); + selectors_ui( + ctx, + ui, + &TensorDimension::from_tensor_data(tensor), + &slice_selection, + &slice_property, + ); }); } let dimension_labels = [ - slice_selection - .width - .map(|width| (dimension_name(&tensor.shape, width.dimension), width.invert)), + slice_selection.width.map(|width| { + ( + dimension_name(&TensorDimension::from_tensor_data(tensor), width.dimension), + width.invert, + ) + }), slice_selection.height.map(|height| { ( - dimension_name(&tensor.shape, height.dimension), + dimension_name(&TensorDimension::from_tensor_data(tensor), height.dimension), height.invert, ) }), diff --git a/crates/viewer/re_view_text_document/README.md b/crates/viewer/re_view_text_document/README.md index 28580760e6cd..bc8b92289567 100644 --- a/crates/viewer/re_view_text_document/README.md +++ b/crates/viewer/re_view_text_document/README.md @@ -2,8 +2,8 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_view_text_document.svg)](https://crates.io/crates/re_view_text_document?speculative-link) -[![Documentation](https://docs.rs/re_view_text_document/badge.svg)](https://docs.rs/re_view_text_document?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_view_text_document.svg)](https://crates.io/crates/re_view_text_document) +[![Documentation](https://docs.rs/re_view_text_document/badge.svg)](https://docs.rs/re_view_text_document) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_view_text_log/README.md b/crates/viewer/re_view_text_log/README.md index 8ae9b824d012..1d0ff0848bf9 100644 --- a/crates/viewer/re_view_text_log/README.md +++ b/crates/viewer/re_view_text_log/README.md @@ -2,8 +2,8 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_view_text_log.svg)](https://crates.io/crates/re_view_text_log?speculative-link) -[![Documentation](https://docs.rs/re_view_text_log/badge.svg)](https://docs.rs/re_view_text_log?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_view_text_log.svg)](https://crates.io/crates/re_view_text_log) +[![Documentation](https://docs.rs/re_view_text_log/badge.svg)](https://docs.rs/re_view_text_log) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_view_time_series/README.md b/crates/viewer/re_view_time_series/README.md index 2c6c7fb5ab32..fc2556bd111d 100644 --- a/crates/viewer/re_view_time_series/README.md +++ b/crates/viewer/re_view_time_series/README.md @@ -2,8 +2,8 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_view_bar_chart.svg)](https://crates.io/crates/re_view_bar_chart?speculative-link) -[![Documentation](https://docs.rs/re_view_bar_chart/badge.svg)](https://docs.rs/re_view_bar_chart?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_view_bar_chart.svg)](https://crates.io/crates/re_view_bar_chart) +[![Documentation](https://docs.rs/re_view_bar_chart/badge.svg)](https://docs.rs/re_view_bar_chart) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_viewer/README.md b/crates/viewer/re_viewer/README.md index adf3ef575924..10c648321f03 100644 --- a/crates/viewer/re_viewer/README.md +++ b/crates/viewer/re_viewer/README.md @@ -2,8 +2,8 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_viewer.svg)](https://crates.io/crates/viewer/re_viewer?speculative-link) -[![Documentation](https://docs.rs/re_viewer/badge.svg)](https://docs.rs/re_viewer?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_viewer.svg)](https://crates.io/crates/viewer/re_viewer) +[![Documentation](https://docs.rs/re_viewer/badge.svg)](https://docs.rs/re_viewer) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_viewer_context/Cargo.toml b/crates/viewer/re_viewer_context/Cargo.toml index a0768622da06..e8cf0eef90d3 100644 --- a/crates/viewer/re_viewer_context/Cargo.toml +++ b/crates/viewer/re_viewer_context/Cargo.toml @@ -74,6 +74,7 @@ wgpu.workspace = true arboard = { workspace = true, default-features = false, features = [ "image-data", ] } +home.workspace = true # Web dependencies: [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/crates/viewer/re_viewer_context/README.md b/crates/viewer/re_viewer_context/README.md index fa3ef603ddc5..7edbbaaf7fde 100644 --- a/crates/viewer/re_viewer_context/README.md +++ b/crates/viewer/re_viewer_context/README.md @@ -2,8 +2,8 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_viewer_context.svg)](https://crates.io/crates/viewer/re_viewer_context?speculative-link) -[![Documentation](https://docs.rs/re_viewer_context/badge.svg)](https://docs.rs/re_viewer_context?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_viewer_context.svg)](https://crates.io/crates/viewer/re_viewer_context) +[![Documentation](https://docs.rs/re_viewer_context/badge.svg)](https://docs.rs/re_viewer_context) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_viewport/README.md b/crates/viewer/re_viewport/README.md index b6bf90cd4967..8bd5548bbb5e 100644 --- a/crates/viewer/re_viewport/README.md +++ b/crates/viewer/re_viewport/README.md @@ -2,8 +2,8 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_viewport.svg)](https://crates.io/crates/re_viewport?speculative-link) -[![Documentation](https://docs.rs/re_viewport/badge.svg)](https://docs.rs/re_viewport?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_viewport.svg)](https://crates.io/crates/re_viewport) +[![Documentation](https://docs.rs/re_viewport/badge.svg)](https://docs.rs/re_viewport) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/crates/viewer/re_viewport_blueprint/README.md b/crates/viewer/re_viewport_blueprint/README.md index ee8c229a13c8..8280a9e5d34b 100644 --- a/crates/viewer/re_viewport_blueprint/README.md +++ b/crates/viewer/re_viewport_blueprint/README.md @@ -2,8 +2,8 @@ Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. -[![Latest version](https://img.shields.io/crates/v/re_viewport_blueprint.svg)](https://crates.io/crates/re_viewport_blueprint?speculative-link) -[![Documentation](https://docs.rs/re_viewport_blueprint/badge.svg)](https://docs.rs/re_viewport_blueprint?speculative-link) +[![Latest version](https://img.shields.io/crates/v/re_viewport_blueprint.svg)](https://crates.io/crates/re_viewport_blueprint) +[![Documentation](https://docs.rs/re_viewport_blueprint/badge.svg)](https://docs.rs/re_viewport_blueprint) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) diff --git a/docs/content/howto/logging/send-columns.md b/docs/content/howto/logging/send-columns.md index 07c6051e8c08..a1b28109f65f 100644 --- a/docs/content/howto/logging/send-columns.md +++ b/docs/content/howto/logging/send-columns.md @@ -33,7 +33,7 @@ snippet: archetypes/points3d_send_columns.py ### Using `send_columns` for logging custom components -An entire batch of a custom component can be logged at once using [`rr.AnyBatchValue`](https://ref.rerun.io/docs/python/0.20.0/common/custom_data/#rerun.AnyBatchValue?speculative-link) along with `send_column`: +An entire batch of a custom component can be logged at once using [`rr.AnyBatchValue`](https://ref.rerun.io/docs/python/0.20.0/common/custom_data/#rerun.AnyBatchValue) along with `send_column`: snippet: howto/any_batch_value_send_columns diff --git a/docs/content/reference/migration/migration-0-21.md b/docs/content/reference/migration/migration-0-21.md index 15c149d369f1..481c17a509bb 100644 --- a/docs/content/reference/migration/migration-0-21.md +++ b/docs/content/reference/migration/migration-0-21.md @@ -3,6 +3,9 @@ title: Migrating from 0.20 to 0.21 order: 989 --- +### File compatibility +We've changed how tensors are encoded in .rrd files, so tensors will no longer load from older .rrd files ([#8376](https://github.com/rerun-io/rerun/pull/8376)). + ### Near clip plane for `Spatial2D` views now defaults to `0.1` in 3D scene units. Previously, the clip plane was set an arbitrary value that worked reasonably for @@ -26,14 +29,15 @@ rr.send_blueprint( ``` -### Types and fields got renamed from `.*space_view.*`/`.*SpaceView.*` to `.*view.*`/`.*View.*` +### Blueprint types and fields got renamed from `.*space_view.*`/`.*SpaceView.*` to `.*view.*`/`.*View.*` Various types and fields got changed to refer to "views" rather than "space views". -This exclusively affects the Python blueprint sdk: +This exclusively affects the Python blueprint sdk. + +#### Field/argument changes -#### Field/argument changes: -* `ViewportBlueprint(...auto_views=...)` -> `ViewportBlueprint(...auto_views=...)` -* `Blueprint(...auto_views=...)` -> `Blueprint(...auto_views=...)` +* `ViewportBlueprint(...auto_space_views=...)` -> `ViewportBlueprint(...auto_views=...)` +* `Blueprint(...auto_space_views=...)` -> `Blueprint(...auto_views=...)` #### Type changes diff --git a/docs/content/reference/types/archetypes/graph_edges.md b/docs/content/reference/types/archetypes/graph_edges.md index 47dc62ca7791..de405287b53b 100644 --- a/docs/content/reference/types/archetypes/graph_edges.md +++ b/docs/content/reference/types/archetypes/graph_edges.md @@ -3,9 +3,6 @@ title: "GraphEdges" --- - -⚠️ **This is an experimental API! It is not fully supported, and is likely to change significantly in future versions.** - A list of edges in a graph. By default, edges are undirected. @@ -21,9 +18,9 @@ By default, edges are undirected. * [DataframeView](../views/dataframe_view.md) ## API reference links - * 🌊 [C++ API docs for `GraphEdges`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1archetypes_1_1GraphEdges.html?speculative-link) - * 🐍 [Python API docs for `GraphEdges`](https://ref.rerun.io/docs/python/stable/common/archetypes?speculative-link#rerun.archetypes.GraphEdges) - * 🦀 [Rust API docs for `GraphEdges`](https://docs.rs/rerun/latest/rerun/archetypes/struct.GraphEdges.html?speculative-link) + * 🌊 [C++ API docs for `GraphEdges`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1archetypes_1_1GraphEdges.html) + * 🐍 [Python API docs for `GraphEdges`](https://ref.rerun.io/docs/python/stable/common/archetypes#rerun.archetypes.GraphEdges) + * 🦀 [Rust API docs for `GraphEdges`](https://docs.rs/rerun/latest/rerun/archetypes/struct.GraphEdges.html) ## Examples diff --git a/docs/content/reference/types/archetypes/graph_nodes.md b/docs/content/reference/types/archetypes/graph_nodes.md index c5b6d38ebab0..69fc86ddb4da 100644 --- a/docs/content/reference/types/archetypes/graph_nodes.md +++ b/docs/content/reference/types/archetypes/graph_nodes.md @@ -3,9 +3,6 @@ title: "GraphNodes" --- - -⚠️ **This is an experimental API! It is not fully supported, and is likely to change significantly in future versions.** - A list of nodes in a graph with optional labels, colors, etc. ## Components @@ -19,9 +16,9 @@ A list of nodes in a graph with optional labels, colors, etc. * [DataframeView](../views/dataframe_view.md) ## API reference links - * 🌊 [C++ API docs for `GraphNodes`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1archetypes_1_1GraphNodes.html?speculative-link) - * 🐍 [Python API docs for `GraphNodes`](https://ref.rerun.io/docs/python/stable/common/archetypes?speculative-link#rerun.archetypes.GraphNodes) - * 🦀 [Rust API docs for `GraphNodes`](https://docs.rs/rerun/latest/rerun/archetypes/struct.GraphNodes.html?speculative-link) + * 🌊 [C++ API docs for `GraphNodes`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1archetypes_1_1GraphNodes.html) + * 🐍 [Python API docs for `GraphNodes`](https://ref.rerun.io/docs/python/stable/common/archetypes#rerun.archetypes.GraphNodes) + * 🦀 [Rust API docs for `GraphNodes`](https://docs.rs/rerun/latest/rerun/archetypes/struct.GraphNodes.html) ## Examples diff --git a/docs/content/reference/types/components/color.md b/docs/content/reference/types/components/color.md index 7e28f1ebae84..835488c2c0cf 100644 --- a/docs/content/reference/types/components/color.md +++ b/docs/content/reference/types/components/color.md @@ -34,7 +34,7 @@ uint32 * [`Ellipsoids3D`](../archetypes/ellipsoids3d.md) * [`GeoLineStrings`](../archetypes/geo_line_strings.md) * [`GeoPoints`](../archetypes/geo_points.md) -* [`GraphNodes`](../archetypes/graph_nodes.md?speculative-link) +* [`GraphNodes`](../archetypes/graph_nodes.md) * [`LineStrips2D`](../archetypes/line_strips2d.md) * [`LineStrips3D`](../archetypes/line_strips3d.md) * [`Mesh3D`](../archetypes/mesh3d.md) diff --git a/docs/content/reference/types/components/graph_edge.md b/docs/content/reference/types/components/graph_edge.md index 7e3d6a7a8300..002d4ef6010f 100644 --- a/docs/content/reference/types/components/graph_edge.md +++ b/docs/content/reference/types/components/graph_edge.md @@ -18,11 +18,11 @@ Struct { ``` ## API reference links - * 🌊 [C++ API docs for `GraphEdge`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1GraphEdge.html?speculative-link) - * 🐍 [Python API docs for `GraphEdge`](https://ref.rerun.io/docs/python/stable/common/components?speculative-link#rerun.components.GraphEdge) - * 🦀 [Rust API docs for `GraphEdge`](https://docs.rs/rerun/latest/rerun/components/struct.GraphEdge.html?speculative-link) + * 🌊 [C++ API docs for `GraphEdge`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1GraphEdge.html) + * 🐍 [Python API docs for `GraphEdge`](https://ref.rerun.io/docs/python/stable/common/components#rerun.components.GraphEdge) + * 🦀 [Rust API docs for `GraphEdge`](https://docs.rs/rerun/latest/rerun/components/struct.GraphEdge.html) ## Used by -* [`GraphEdges`](../archetypes/graph_edges.md?speculative-link) +* [`GraphEdges`](../archetypes/graph_edges.md) diff --git a/docs/content/reference/types/components/graph_node.md b/docs/content/reference/types/components/graph_node.md index 23e0732351b0..638c20cf3217 100644 --- a/docs/content/reference/types/components/graph_node.md +++ b/docs/content/reference/types/components/graph_node.md @@ -15,11 +15,11 @@ utf8 ``` ## API reference links - * 🌊 [C++ API docs for `GraphNode`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1GraphNode.html?speculative-link) - * 🐍 [Python API docs for `GraphNode`](https://ref.rerun.io/docs/python/stable/common/components?speculative-link#rerun.components.GraphNode) - * 🦀 [Rust API docs for `GraphNode`](https://docs.rs/rerun/latest/rerun/components/struct.GraphNode.html?speculative-link) + * 🌊 [C++ API docs for `GraphNode`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1GraphNode.html) + * 🐍 [Python API docs for `GraphNode`](https://ref.rerun.io/docs/python/stable/common/components#rerun.components.GraphNode) + * 🦀 [Rust API docs for `GraphNode`](https://docs.rs/rerun/latest/rerun/components/struct.GraphNode.html) ## Used by -* [`GraphNodes`](../archetypes/graph_nodes.md?speculative-link) +* [`GraphNodes`](../archetypes/graph_nodes.md) diff --git a/docs/content/reference/types/components/graph_type.md b/docs/content/reference/types/components/graph_type.md index 5bb3a94c79ec..24aa3323c707 100644 --- a/docs/content/reference/types/components/graph_type.md +++ b/docs/content/reference/types/components/graph_type.md @@ -19,11 +19,11 @@ uint8 ``` ## API reference links - * 🌊 [C++ API docs for `GraphType`](https://ref.rerun.io/docs/cpp/stable/namespacererun_1_1components.html?speculative-link) - * 🐍 [Python API docs for `GraphType`](https://ref.rerun.io/docs/python/stable/common/components?speculative-link#rerun.components.GraphType) - * 🦀 [Rust API docs for `GraphType`](https://docs.rs/rerun/latest/rerun/components/enum.GraphType.html?speculative-link) + * 🌊 [C++ API docs for `GraphType`](https://ref.rerun.io/docs/cpp/stable/namespacererun_1_1components.html) + * 🐍 [Python API docs for `GraphType`](https://ref.rerun.io/docs/python/stable/common/components#rerun.components.GraphType) + * 🦀 [Rust API docs for `GraphType`](https://docs.rs/rerun/latest/rerun/components/enum.GraphType.html) ## Used by -* [`GraphEdges`](../archetypes/graph_edges.md?speculative-link) +* [`GraphEdges`](../archetypes/graph_edges.md) diff --git a/docs/content/reference/types/components/plane3d.md b/docs/content/reference/types/components/plane3d.md index 58d7e4e31c40..4dc7f25f7c0c 100644 --- a/docs/content/reference/types/components/plane3d.md +++ b/docs/content/reference/types/components/plane3d.md @@ -23,8 +23,8 @@ FixedSizeList<4, float32> ``` ## API reference links - * 🌊 [C++ API docs for `Plane3D`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1Plane3D.html?speculative-link) - * 🐍 [Python API docs for `Plane3D`](https://ref.rerun.io/docs/python/stable/common/components?speculative-link#rerun.components.Plane3D) - * 🦀 [Rust API docs for `Plane3D`](https://docs.rs/rerun/latest/rerun/components/struct.Plane3D.html?speculative-link) + * 🌊 [C++ API docs for `Plane3D`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1Plane3D.html) + * 🐍 [Python API docs for `Plane3D`](https://ref.rerun.io/docs/python/stable/common/components#rerun.components.Plane3D) + * 🦀 [Rust API docs for `Plane3D`](https://docs.rs/rerun/latest/rerun/components/struct.Plane3D.html) diff --git a/docs/content/reference/types/components/position2d.md b/docs/content/reference/types/components/position2d.md index faa24a3318ab..78f839ff55db 100644 --- a/docs/content/reference/types/components/position2d.md +++ b/docs/content/reference/types/components/position2d.md @@ -24,5 +24,5 @@ FixedSizeList<2, float32> * [`Arrows2D`](../archetypes/arrows2d.md) * [`Boxes2D`](../archetypes/boxes2d.md) -* [`GraphNodes`](../archetypes/graph_nodes.md?speculative-link) +* [`GraphNodes`](../archetypes/graph_nodes.md) * [`Points2D`](../archetypes/points2d.md) diff --git a/docs/content/reference/types/components/radius.md b/docs/content/reference/types/components/radius.md index 3d976dd859d9..e0ded53ec2f4 100644 --- a/docs/content/reference/types/components/radius.md +++ b/docs/content/reference/types/components/radius.md @@ -37,7 +37,7 @@ float32 * [`Ellipsoids3D`](../archetypes/ellipsoids3d.md) * [`GeoLineStrings`](../archetypes/geo_line_strings.md) * [`GeoPoints`](../archetypes/geo_points.md) -* [`GraphNodes`](../archetypes/graph_nodes.md?speculative-link) +* [`GraphNodes`](../archetypes/graph_nodes.md) * [`LineStrips2D`](../archetypes/line_strips2d.md) * [`LineStrips3D`](../archetypes/line_strips3d.md) * [`Points2D`](../archetypes/points2d.md) diff --git a/docs/content/reference/types/components/recording_uri.md b/docs/content/reference/types/components/recording_uri.md index 99133fc12b35..0e002267a23d 100644 --- a/docs/content/reference/types/components/recording_uri.md +++ b/docs/content/reference/types/components/recording_uri.md @@ -15,8 +15,8 @@ utf8 ``` ## API reference links - * 🌊 [C++ API docs for `RecordingUri`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1RecordingUri.html?speculative-link) - * 🐍 [Python API docs for `RecordingUri`](https://ref.rerun.io/docs/python/stable/common/components?speculative-link#rerun.components.RecordingUri) - * 🦀 [Rust API docs for `RecordingUri`](https://docs.rs/rerun/latest/rerun/components/struct.RecordingUri.html?speculative-link) + * 🌊 [C++ API docs for `RecordingUri`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1RecordingUri.html) + * 🐍 [Python API docs for `RecordingUri`](https://ref.rerun.io/docs/python/stable/common/components#rerun.components.RecordingUri) + * 🦀 [Rust API docs for `RecordingUri`](https://docs.rs/rerun/latest/rerun/components/struct.RecordingUri.html) diff --git a/docs/content/reference/types/components/show_labels.md b/docs/content/reference/types/components/show_labels.md index 1f81d6c88e8f..81c2df55751c 100644 --- a/docs/content/reference/types/components/show_labels.md +++ b/docs/content/reference/types/components/show_labels.md @@ -32,7 +32,7 @@ boolean * [`Boxes3D`](../archetypes/boxes3d.md) * [`Capsules3D`](../archetypes/capsules3d.md) * [`Ellipsoids3D`](../archetypes/ellipsoids3d.md) -* [`GraphNodes`](../archetypes/graph_nodes.md?speculative-link) +* [`GraphNodes`](../archetypes/graph_nodes.md) * [`LineStrips2D`](../archetypes/line_strips2d.md) * [`LineStrips3D`](../archetypes/line_strips3d.md) * [`Points2D`](../archetypes/points2d.md) diff --git a/docs/content/reference/types/components/tensor_data.md b/docs/content/reference/types/components/tensor_data.md index 212c6f45a755..3de2724c3242 100644 --- a/docs/content/reference/types/components/tensor_data.md +++ b/docs/content/reference/types/components/tensor_data.md @@ -19,10 +19,8 @@ which stores a contiguous array of typed values. ## Arrow datatype ``` Struct { - shape: List + shape: List + names: nullable List buffer: DenseUnion { 0 = "_null_markers": nullable null 1 = "U8": List diff --git a/docs/content/reference/types/components/text.md b/docs/content/reference/types/components/text.md index 456c2fc088df..c4dfafa3c62d 100644 --- a/docs/content/reference/types/components/text.md +++ b/docs/content/reference/types/components/text.md @@ -28,7 +28,7 @@ utf8 * [`Boxes3D`](../archetypes/boxes3d.md) * [`Capsules3D`](../archetypes/capsules3d.md) * [`Ellipsoids3D`](../archetypes/ellipsoids3d.md) -* [`GraphNodes`](../archetypes/graph_nodes.md?speculative-link) +* [`GraphNodes`](../archetypes/graph_nodes.md) * [`LineStrips2D`](../archetypes/line_strips2d.md) * [`LineStrips3D`](../archetypes/line_strips3d.md) * [`Points2D`](../archetypes/points2d.md) diff --git a/docs/content/reference/types/datatypes.md b/docs/content/reference/types/datatypes.md index 6902ee39e313..b12bd42d39db 100644 --- a/docs/content/reference/types/datatypes.md +++ b/docs/content/reference/types/datatypes.md @@ -34,7 +34,6 @@ Data types are the lowest layer of the data model hierarchy. They are re-usable * [`RotationAxisAngle`](datatypes/rotation_axis_angle.md): 3D rotation represented by a rotation around a given axis. * [`TensorBuffer`](datatypes/tensor_buffer.md): The underlying storage for [`archetypes.Tensor`](https://rerun.io/docs/reference/types/archetypes/tensor). * [`TensorData`](datatypes/tensor_data.md): An N-dimensional array of numbers. -* [`TensorDimension`](datatypes/tensor_dimension.md): A single dimension within a multi-dimensional tensor. * [`TensorDimensionIndexSelection`](datatypes/tensor_dimension_index_selection.md): Indexing a specific tensor dimension. * [`TensorDimensionSelection`](datatypes/tensor_dimension_selection.md): Selection of a single tensor dimension. * [`TimeInt`](datatypes/time_int.md): A 64-bit number describing either nanoseconds OR sequence numbers. diff --git a/docs/content/reference/types/datatypes/.gitattributes b/docs/content/reference/types/datatypes/.gitattributes index 3454eebe12d8..771fe1303bcf 100644 --- a/docs/content/reference/types/datatypes/.gitattributes +++ b/docs/content/reference/types/datatypes/.gitattributes @@ -28,7 +28,6 @@ rgba32.md linguist-generated=true rotation_axis_angle.md linguist-generated=true tensor_buffer.md linguist-generated=true tensor_data.md linguist-generated=true -tensor_dimension.md linguist-generated=true tensor_dimension_index_selection.md linguist-generated=true tensor_dimension_selection.md linguist-generated=true time_int.md linguist-generated=true diff --git a/docs/content/reference/types/datatypes/plane3d.md b/docs/content/reference/types/datatypes/plane3d.md index 3f0973d64b6d..94cb6e572b38 100644 --- a/docs/content/reference/types/datatypes/plane3d.md +++ b/docs/content/reference/types/datatypes/plane3d.md @@ -20,11 +20,11 @@ FixedSizeList<4, float32> ``` ## API reference links - * 🌊 [C++ API docs for `Plane3D`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1datatypes_1_1Plane3D.html?speculative-link) - * 🐍 [Python API docs for `Plane3D`](https://ref.rerun.io/docs/python/stable/common/datatypes?speculative-link#rerun.datatypes.Plane3D) - * 🦀 [Rust API docs for `Plane3D`](https://docs.rs/rerun/latest/rerun/datatypes/struct.Plane3D.html?speculative-link) + * 🌊 [C++ API docs for `Plane3D`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1datatypes_1_1Plane3D.html) + * 🐍 [Python API docs for `Plane3D`](https://ref.rerun.io/docs/python/stable/common/datatypes#rerun.datatypes.Plane3D) + * 🦀 [Rust API docs for `Plane3D`](https://docs.rs/rerun/latest/rerun/datatypes/struct.Plane3D.html) ## Used by -* [`Plane3D`](../components/plane3d.md?speculative-link) +* [`Plane3D`](../components/plane3d.md) diff --git a/docs/content/reference/types/datatypes/tensor_data.md b/docs/content/reference/types/datatypes/tensor_data.md index d8af8ecbb674..abc09ba17823 100644 --- a/docs/content/reference/types/datatypes/tensor_data.md +++ b/docs/content/reference/types/datatypes/tensor_data.md @@ -14,9 +14,20 @@ which stores a contiguous array of typed values. ## Fields #### `shape` -Type: List of [`TensorDimension`](../datatypes/tensor_dimension.md) +Type: List of `uint64` -The shape of the tensor, including optional names for each dimension. +The shape of the tensor, i.e. the length of each dimension. + +#### `names` +Type: nullable List of `utf8` + +The names of the dimensions of the tensor (optional). + +If set, should be the same length as [`datatypes.TensorData#shape`](https://rerun.io/docs/reference/types/datatypes/tensor_data). +If it has a different length your names may show up improperly, +and some constructors may produce a warning or even an error. + +Example: `["height", "width", "channel", "batch"]`. #### `buffer` Type: [`TensorBuffer`](../datatypes/tensor_buffer.md) @@ -27,10 +38,8 @@ The content/data. ## Arrow datatype ``` Struct { - shape: List + shape: List + names: nullable List buffer: DenseUnion { 0 = "_null_markers": nullable null 1 = "U8": List diff --git a/docs/content/reference/types/datatypes/tensor_dimension.md b/docs/content/reference/types/datatypes/tensor_dimension.md deleted file mode 100644 index 71d1446ed11e..000000000000 --- a/docs/content/reference/types/datatypes/tensor_dimension.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: "TensorDimension" ---- - - -A single dimension within a multi-dimensional tensor. - -## Fields -#### `size` -Type: `uint64` - -The length of this dimension. - -#### `name` -Type: nullable `utf8` - -The name of this dimension, e.g. "width", "height", "channel", "batch', …. - - -## Arrow datatype -``` -Struct { - size: uint64 - name: nullable utf8 -} -``` - -## API reference links - * 🌊 [C++ API docs for `TensorDimension`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1datatypes_1_1TensorDimension.html) - * 🐍 [Python API docs for `TensorDimension`](https://ref.rerun.io/docs/python/stable/common/datatypes#rerun.datatypes.TensorDimension) - * 🦀 [Rust API docs for `TensorDimension`](https://docs.rs/rerun/latest/rerun/datatypes/struct.TensorDimension.html) - - -## Used by - -* [`TensorData`](../datatypes/tensor_data.md) diff --git a/docs/content/reference/types/datatypes/utf8.md b/docs/content/reference/types/datatypes/utf8.md index b4180a94ad44..092555b91625 100644 --- a/docs/content/reference/types/datatypes/utf8.md +++ b/docs/content/reference/types/datatypes/utf8.md @@ -20,11 +20,11 @@ utf8 ## Used by * [`AnnotationInfo`](../datatypes/annotation_info.md) -* [`GraphNode`](../components/graph_node.md?speculative-link) +* [`GraphNode`](../components/graph_node.md) * [`MediaType`](../components/media_type.md) * [`Name`](../components/name.md) -* [`RecordingUri`](../components/recording_uri.md?speculative-link) +* [`RecordingUri`](../components/recording_uri.md) * [`TextLogLevel`](../components/text_log_level.md) * [`Text`](../components/text.md) -* [`Utf8Pair`](../datatypes/utf8pair.md?speculative-link) +* [`Utf8Pair`](../datatypes/utf8pair.md) * [`VisibleTimeRange`](../datatypes/visible_time_range.md) diff --git a/docs/content/reference/types/datatypes/utf8pair.md b/docs/content/reference/types/datatypes/utf8pair.md index 1815cd16438e..15cb7fb87d49 100644 --- a/docs/content/reference/types/datatypes/utf8pair.md +++ b/docs/content/reference/types/datatypes/utf8pair.md @@ -26,11 +26,11 @@ Struct { ``` ## API reference links - * 🌊 [C++ API docs for `Utf8Pair`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1datatypes_1_1Utf8Pair.html?speculative-link) - * 🐍 [Python API docs for `Utf8Pair`](https://ref.rerun.io/docs/python/stable/common/datatypes?speculative-link#rerun.datatypes.Utf8Pair) - * 🦀 [Rust API docs for `Utf8Pair`](https://docs.rs/rerun/latest/rerun/datatypes/struct.Utf8Pair.html?speculative-link) + * 🌊 [C++ API docs for `Utf8Pair`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1datatypes_1_1Utf8Pair.html) + * 🐍 [Python API docs for `Utf8Pair`](https://ref.rerun.io/docs/python/stable/common/datatypes#rerun.datatypes.Utf8Pair) + * 🦀 [Rust API docs for `Utf8Pair`](https://docs.rs/rerun/latest/rerun/datatypes/struct.Utf8Pair.html) ## Used by -* [`GraphEdge`](../components/graph_edge.md?speculative-link) +* [`GraphEdge`](../components/graph_edge.md) diff --git a/docs/content/reference/types/views/graph_view.md b/docs/content/reference/types/views/graph_view.md index e222d74616b7..e76a96c14613 100644 --- a/docs/content/reference/types/views/graph_view.md +++ b/docs/content/reference/types/views/graph_view.md @@ -41,7 +41,7 @@ Tries to move the center of mass of the graph to the origin. * `strength`: The strength of the force. ## API reference links - * 🐍 [Python API docs for `GraphView`](https://ref.rerun.io/docs/python/stable/common/blueprint_views?speculative-link#rerun.blueprint.views.GraphView) + * 🐍 [Python API docs for `GraphView`](https://ref.rerun.io/docs/python/stable/common/blueprint_views#rerun.blueprint.views.GraphView) ## Example diff --git a/docs/snippets/INDEX.md b/docs/snippets/INDEX.md index d64fed561048..16ee05d96c03 100644 --- a/docs/snippets/INDEX.md +++ b/docs/snippets/INDEX.md @@ -25,7 +25,7 @@ Use it to quickly find copy-pastable snippets of code for any Rerun feature you' | **Dataframes** | `dataframe_query` | Query and display the first 10 rows of a recording | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/reference/dataframe_query.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/reference/dataframe_query.rs) | | | **Dataframes** | `dataframe_view_query` | Query and display the first 10 rows of a recording in a dataframe view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/reference/dataframe_view_query.py) | | | | **`AnyValue`** | `any_values` | Log arbitrary data | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/tutorials/any_values.py) | | | -| **`AnyValue`** | `any_values_send_columns` | Use `AnyValues` and `send_column` to send entire columns of custom data to Rerun | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/howto/any_values_send_columns.py?speculative-link) | | | +| **`AnyValue`** | `any_values_send_columns` | Use `AnyValues` and `send_column` to send entire columns of custom data to Rerun | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/howto/any_values_send_columns.py) | | | | **`AnyValue`** | `extra_values` | Log extra values with a Points2D | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/tutorials/extra_values.py) | | | @@ -82,11 +82,11 @@ _All snippets, organized by the [`Archetype`](https://rerun.io/docs/reference/ty | **[`GeoLineStrings`](https://rerun.io/docs/reference/types/archetypes/geo_line_strings)** | `archetypes/geo_line_strings_simple` | Log a simple geospatial line string | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_line_strings_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_line_strings_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_line_strings_simple.cpp) | | **[`GeoPoints`](https://rerun.io/docs/reference/types/archetypes/geo_points)** | `archetypes/geo_points_simple` | Log some very simple geospatial point | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_points_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_points_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_points_simple.cpp) | | **[`GeoPoints`](https://rerun.io/docs/reference/types/archetypes/geo_points)** | `views/map` | Use a blueprint to customize a map view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/map.py) | | | -| **[`GraphEdges`](https://rerun.io/docs/reference/types/archetypes/graph_edges?speculative-link)** | `archetypes/graph_directed` | Log a simple directed graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.cpp?speculative-link) | -| **[`GraphEdges`](https://rerun.io/docs/reference/types/archetypes/graph_edges?speculative-link)** | `archetypes/graph_undirected` | Log a simple undirected graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.cpp?speculative-link) | -| **[`GraphNodes`](https://rerun.io/docs/reference/types/archetypes/graph_nodes?speculative-link)** | `archetypes/graph_directed` | Log a simple directed graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.cpp?speculative-link) | -| **[`GraphNodes`](https://rerun.io/docs/reference/types/archetypes/graph_nodes?speculative-link)** | `archetypes/graph_undirected` | Log a simple undirected graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.cpp?speculative-link) | -| **[`GraphNodes`](https://rerun.io/docs/reference/types/archetypes/graph_nodes?speculative-link)** | `views/graph` | Use a blueprint to customize a graph view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/graph.py?speculative-link?speculative-link) | | | +| **[`GraphEdges`](https://rerun.io/docs/reference/types/archetypes/graph_edges)** | `archetypes/graph_directed` | Log a simple directed graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.cpp) | +| **[`GraphEdges`](https://rerun.io/docs/reference/types/archetypes/graph_edges)** | `archetypes/graph_undirected` | Log a simple undirected graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.cpp) | +| **[`GraphNodes`](https://rerun.io/docs/reference/types/archetypes/graph_nodes)** | `archetypes/graph_directed` | Log a simple directed graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.cpp) | +| **[`GraphNodes`](https://rerun.io/docs/reference/types/archetypes/graph_nodes)** | `archetypes/graph_undirected` | Log a simple undirected graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.cpp) | +| **[`GraphNodes`](https://rerun.io/docs/reference/types/archetypes/graph_nodes)** | `views/graph` | Use a blueprint to customize a graph view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/graph.py) | | | | **[`Image`](https://rerun.io/docs/reference/types/archetypes/image)** | `archetypes/segmentation_image_simple` | Create and log a segmentation image | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/segmentation_image_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/segmentation_image_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/segmentation_image_simple.cpp) | | **[`Image`](https://rerun.io/docs/reference/types/archetypes/image)** | `archetypes/image_simple` | Create and log an image | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_simple.cpp) | | **[`Image`](https://rerun.io/docs/reference/types/archetypes/image)** | `archetypes/image_send_columns` | Send multiple images at once using `send_columns` | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_send_columns.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_send_columns.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_send_columns.cpp) | @@ -135,9 +135,9 @@ _All snippets, organized by the [`Archetype`](https://rerun.io/docs/reference/ty | **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `archetypes/instance_poses3d_combined` | Log a simple 3D box with a regular & instance pose transform | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/instance_poses3d_combined.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/instance_poses3d_combined.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/instance_poses3d_combined.cpp) | | **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `archetypes/pinhole_perspective` | Logs a point cloud and a perspective camera looking at it | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/pinhole_perspective.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/pinhole_perspective.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/pinhole_perspective.cpp) | | **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `archetypes/transform3d_hierarchy` | Logs a transforms transform hierarchy | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.cpp) | -| **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `concepts/explicit_recording` | Just makes sure that explicit recordings actually work | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/explicit_recording.py?speculative-link) | | | -| **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `descriptors/descr_builtin_archetype` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_archetype.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_archetype.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_archetype.cpp?speculative-link) | -| **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `descriptors/descr_custom_archetype` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.cpp?speculative-link) | +| **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `concepts/explicit_recording` | Just makes sure that explicit recordings actually work | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/explicit_recording.py) | | | +| **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `descriptors/descr_builtin_archetype` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_archetype.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_archetype.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_archetype.cpp) | +| **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `descriptors/descr_custom_archetype` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.cpp) | | **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `migration/log_line` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/migration/log_line.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/migration/log_line.rs) | | | **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `quick_start/quick_start_connect` | Connect to the viewer and log some data | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/quick_start/quick_start_connect.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/quick_start/quick_start_connect.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/quick_start/quick_start_connect.cpp) | | **[`Points3D`](https://rerun.io/docs/reference/types/archetypes/points3d)** | `quick_start/quick_start_spawn` | Spawn a viewer and log some data | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/quick_start/quick_start_spawn.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/quick_start/quick_start_spawn.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/quick_start/quick_start_spawn.cpp) | @@ -204,25 +204,25 @@ _All snippets, organized by the [`Component`](https://rerun.io/docs/reference/ty | **[`Color`](https://rerun.io/docs/reference/types/components/color)** | `concepts/viscomp-component-override` | Override a component | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/viscomp-component-override.py) | | | | **[`Color`](https://rerun.io/docs/reference/types/components/color)** | `concepts/viscomp-visualizer-override` | Override a visualizer | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/viscomp-visualizer-override.py) | | | | **[`Color`](https://rerun.io/docs/reference/types/components/color)** | `concepts/viscomp-visualizer-override-multiple` | Override a visualizer | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/viscomp-visualizer-override-multiple.py) | | | -| **[`Color`](https://rerun.io/docs/reference/types/components/color)** | `descriptors/descr_custom_archetype` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.cpp?speculative-link) | +| **[`Color`](https://rerun.io/docs/reference/types/components/color)** | `descriptors/descr_custom_archetype` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.cpp) | | **[`Color`](https://rerun.io/docs/reference/types/components/color)** | `views/spatial3d` | Use a blueprint to customize a Spatial3DView | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/spatial3d.py) | | | | **[`DisconnectedSpace`](https://rerun.io/docs/reference/types/components/disconnected_space)** | `archetypes/disconnected_space` | Disconnect two spaces | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/disconnected_space.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/disconnected_space.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/disconnected_space.cpp) | | **[`GeoLineString`](https://rerun.io/docs/reference/types/components/geo_line_string)** | `archetypes/geo_line_strings_simple` | Log a simple geospatial line string | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_line_strings_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_line_strings_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_line_strings_simple.cpp) | -| **[`GraphEdge`](https://rerun.io/docs/reference/types/components/graph_edge?speculative-link)** | `archetypes/graph_directed` | Log a simple directed graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.cpp?speculative-link) | -| **[`GraphEdge`](https://rerun.io/docs/reference/types/components/graph_edge?speculative-link)** | `archetypes/graph_undirected` | Log a simple undirected graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.cpp?speculative-link) | -| **[`GraphNode`](https://rerun.io/docs/reference/types/components/graph_node?speculative-link)** | `archetypes/graph_directed` | Log a simple directed graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.cpp?speculative-link) | -| **[`GraphNode`](https://rerun.io/docs/reference/types/components/graph_node?speculative-link)** | `archetypes/graph_undirected` | Log a simple undirected graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.cpp?speculative-link) | -| **[`GraphNode`](https://rerun.io/docs/reference/types/components/graph_node?speculative-link)** | `views/graph` | Use a blueprint to customize a graph view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/graph.py?speculative-link?speculative-link) | | | +| **[`GraphEdge`](https://rerun.io/docs/reference/types/components/graph_edge)** | `archetypes/graph_directed` | Log a simple directed graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.cpp) | +| **[`GraphEdge`](https://rerun.io/docs/reference/types/components/graph_edge)** | `archetypes/graph_undirected` | Log a simple undirected graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.cpp) | +| **[`GraphNode`](https://rerun.io/docs/reference/types/components/graph_node)** | `archetypes/graph_directed` | Log a simple directed graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_directed.cpp) | +| **[`GraphNode`](https://rerun.io/docs/reference/types/components/graph_node)** | `archetypes/graph_undirected` | Log a simple undirected graph | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/graph_undirected.cpp) | +| **[`GraphNode`](https://rerun.io/docs/reference/types/components/graph_node)** | `views/graph` | Use a blueprint to customize a graph view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/graph.py) | | | | **[`ImageBuffer`](https://rerun.io/docs/reference/types/components/image_buffer)** | `archetypes/image_send_columns` | Send multiple images at once using `send_columns` | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_send_columns.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_send_columns.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_send_columns.cpp) | | **[`ImageFormat`](https://rerun.io/docs/reference/types/components/image_format)** | `archetypes/image_send_columns` | Send multiple images at once using `send_columns` | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_send_columns.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_send_columns.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_send_columns.cpp) | | **[`MediaType`](https://rerun.io/docs/reference/types/components/media_type)** | `archetypes/text_document` | Log a `TextDocument` | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/text_document.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/text_document.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/text_document.cpp) | | **[`MediaType`](https://rerun.io/docs/reference/types/components/media_type)** | `views/text_document` | Use a blueprint to show a text document | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/text_document.py) | | | -| **[`Plane3D`](https://rerun.io/docs/reference/types/components/plane3d?speculative-link)** | `views/spatial3d` | Use a blueprint to customize a Spatial3DView | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/spatial3d.py?speculative-link) | | | +| **[`Plane3D`](https://rerun.io/docs/reference/types/components/plane3d)** | `views/spatial3d` | Use a blueprint to customize a Spatial3DView | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/spatial3d.py) | | | | **[`Position3D`](https://rerun.io/docs/reference/types/components/position3d)** | `archetypes/mesh3d_partial_updates` | Log a simple colored triangle, then update its vertices' positions each frame | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mesh3d_partial_updates.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mesh3d_partial_updates.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mesh3d_partial_updates.cpp) | | **[`Position3D`](https://rerun.io/docs/reference/types/components/position3d)** | `archetypes/points3d_send_columns` | Use the `send_columns` API to send several point clouds over time in a single call | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points3d_send_columns.py) | | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points3d_send_columns.cpp) | -| **[`Position3D`](https://rerun.io/docs/reference/types/components/position3d)** | `descriptors/descr_builtin_component` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_component.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_component.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_component.cpp?speculative-link) | -| **[`Position3D`](https://rerun.io/docs/reference/types/components/position3d)** | `descriptors/descr_custom_archetype` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.cpp?speculative-link) | -| **[`Position3D`](https://rerun.io/docs/reference/types/components/position3d)** | `descriptors/descr_custom_component` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_component.py?speculative-link) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_component.rs?speculative-link) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_component.cpp?speculative-link) | +| **[`Position3D`](https://rerun.io/docs/reference/types/components/position3d)** | `descriptors/descr_builtin_component` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_component.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_component.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_builtin_component.cpp) | +| **[`Position3D`](https://rerun.io/docs/reference/types/components/position3d)** | `descriptors/descr_custom_archetype` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_archetype.cpp) | +| **[`Position3D`](https://rerun.io/docs/reference/types/components/position3d)** | `descriptors/descr_custom_component` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_component.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_component.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/descriptors/descr_custom_component.cpp) | | **[`Radius`](https://rerun.io/docs/reference/types/components/radius)** | `archetypes/points3d_ui_radius` | Log some points with ui points & scene unit radii | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points3d_ui_radius.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points3d_ui_radius.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points3d_ui_radius.cpp) | | **[`Radius`](https://rerun.io/docs/reference/types/components/radius)** | `archetypes/points2d_ui_radius` | Log some points with ui points & scene unit radii | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points2d_ui_radius.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points2d_ui_radius.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points2d_ui_radius.cpp) | | **[`Radius`](https://rerun.io/docs/reference/types/components/radius)** | `archetypes/line_strips3d_ui_radius` | Log lines with ui points & scene unit radii | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips3d_ui_radius.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips3d_ui_radius.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips3d_ui_radius.cpp) | @@ -280,7 +280,7 @@ _All snippets, organized by the [`View`](https://rerun.io/docs/reference/types/v | **[`DataframeView`](https://rerun.io/docs/reference/types/views/dataframe_view)** | `reference/dataframe_view_query` | Query and display the first 10 rows of a recording in a dataframe view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/reference/dataframe_view_query.py) | | | | **[`DataframeView`](https://rerun.io/docs/reference/types/views/dataframe_view)** | `reference/dataframe_save_blueprint` | Craft a blueprint with the python API and save it to a file for future use | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/reference/dataframe_save_blueprint.py) | | | | **[`DataframeView`](https://rerun.io/docs/reference/types/views/dataframe_view)** | `views/dataframe` | Use a blueprint to customize a DataframeView | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/dataframe.py) | | | -| **[`GraphView`](https://rerun.io/docs/reference/types/views/graph_view?speculative-link)** | `views/graph` | Use a blueprint to customize a graph view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/graph.py?speculative-link?speculative-link) | | | +| **[`GraphView`](https://rerun.io/docs/reference/types/views/graph_view)** | `views/graph` | Use a blueprint to customize a graph view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/graph.py) | | | | **[`MapView`](https://rerun.io/docs/reference/types/views/map_view)** | `views/map` | Use a blueprint to customize a map view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/map.py) | | | | **[`Spatial2DView`](https://rerun.io/docs/reference/types/views/spatial2d_view)** | `archetypes/line_strips2d_batch` | Log a batch of 2D line strips | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips2d_batch.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips2d_batch.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips2d_batch.cpp) | | **[`Spatial2DView`](https://rerun.io/docs/reference/types/views/spatial2d_view)** | `archetypes/line_strips2d_segments_simple` | Log a couple 2D line segments using 2D line strips | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips2d_segments_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips2d_segments_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips2d_segments_simple.cpp) | @@ -333,7 +333,7 @@ _All snippets, organized by the blueprint-related [`Archetype`](https://rerun.io | **`VisualBounds2D`** | `archetypes/points2d_ui_radius` | Log some points with ui points & scene unit radii | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points2d_ui_radius.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points2d_ui_radius.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points2d_ui_radius.cpp) | | **`VisualBounds2D`** | `concepts/different_data_per_timeline` | Log different data on different timelines | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/different_data_per_timeline.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/different_data_per_timeline.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/different_data_per_timeline.cpp) | | **`VisualBounds2D`** | `tutorials/extra_values` | Log extra values with a Points2D | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/tutorials/extra_values.py) | | | -| **`VisualBounds2D`** | `views/graph` | Use a blueprint to customize a graph view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/graph.py?speculative-link) | | | +| **`VisualBounds2D`** | `views/graph` | Use a blueprint to customize a graph view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/graph.py) | | | | **`VisualBounds2D`** | `views/spatial2d` | Use a blueprint to customize a Spatial2DView | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/spatial2d.py) | | | @@ -357,7 +357,7 @@ _All snippets, organized by the blueprint-related [`Component`](https://rerun.io | **`VisualBounds2D`** | `archetypes/points2d_ui_radius` | Log some points with ui points & scene unit radii | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points2d_ui_radius.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points2d_ui_radius.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/points2d_ui_radius.cpp) | | **`VisualBounds2D`** | `concepts/different_data_per_timeline` | Log different data on different timelines | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/different_data_per_timeline.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/different_data_per_timeline.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/different_data_per_timeline.cpp) | | **`VisualBounds2D`** | `tutorials/extra_values` | Log extra values with a Points2D | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/tutorials/extra_values.py) | | | -| **`VisualBounds2D`** | `views/graph` | Use a blueprint to customize a graph view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/graph.py?speculative-link) | | | +| **`VisualBounds2D`** | `views/graph` | Use a blueprint to customize a graph view | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/graph.py) | | | | **`VisualBounds2D`** | `views/spatial2d` | Use a blueprint to customize a Spatial2DView | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/views/spatial2d.py) | | | | **`VisualizerOverrides`** | `concepts/viscomp-visualizer-override` | Override a visualizer | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/viscomp-visualizer-override.py) | | | | **`VisualizerOverrides`** | `concepts/viscomp-visualizer-override-multiple` | Override a visualizer | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/viscomp-visualizer-override-multiple.py) | | | diff --git a/docs/snippets/README.md b/docs/snippets/README.md index a221615ae85a..21d51dcb2c10 100644 --- a/docs/snippets/README.md +++ b/docs/snippets/README.md @@ -11,7 +11,7 @@ You can run each example individually using the following: - **C++**: - `pixi run -e cpp cpp-build-snippets` to compile all examples - `./build/debug/docs/snippets/all/` to run, e.g. `./build/debug/docs/snippets/all/point3d_random` -- **Python**: `pixi run -e py python .py`, e.g. `pixi run -e py python point3d_random.py`. +- **Python**: `pixi run py-build && pixi run -e py python .py`, e.g. `pixi run -e py python point3d_random.py`. - **Rust**: `cargo run -p snippets -- [args]`, e.g. `cargo run -p snippets -- point3d_random`. ## Comparison test @@ -23,8 +23,8 @@ These tests check that A) all of our SDKs yield the exact same data when used th ### Usage -To run the comparison tests, check out `./docs/snippets/compare_snippet_output.py --help`. -`./docs/snippets/compare_snippet_output.py` is a valid invocation that will build all 3 SDKs and run all tests for all of them. +To run the comparison tests, check out `pixi run -e py docs/snippets/compare_snippet_output.py --help`. +`pixi run -e py docs/snippets/compare_snippet_output.py` is a valid invocation that will build all 3 SDKs and run all tests for all of them. ### Implementing new tests diff --git a/examples/python/graph_lattice/README.md b/examples/python/graph_lattice/README.md index a44ec2eeab8d..f6d55edcd3c9 100644 --- a/examples/python/graph_lattice/README.md +++ b/examples/python/graph_lattice/README.md @@ -17,8 +17,8 @@ Since no explicit positions are passed for the nodes, Rerun will layout the grap ## Used Rerun types -[`GraphNodes`](https://www.rerun.io/docs/reference/types/archetypes/graph_nodes?speculative-link), -[`GraphEdges`](https://www.rerun.io/docs/reference/types/archetypes/graph_edges?speculative-link) +[`GraphNodes`](https://www.rerun.io/docs/reference/types/archetypes/graph_nodes), +[`GraphEdges`](https://www.rerun.io/docs/reference/types/archetypes/graph_edges) ## Run the code diff --git a/examples/python/graph_lattice/graph_lattice.py b/examples/python/graph_lattice/graph_lattice.py index 21eb327df1ca..0df3efa1f7d3 100644 --- a/examples/python/graph_lattice/graph_lattice.py +++ b/examples/python/graph_lattice/graph_lattice.py @@ -17,7 +17,7 @@ In this example, the node positions—and therefore the graph layout—are computed by Rerun internally. The full source code for this example is available -[on GitHub](https://github.com/rerun-io/rerun/blob/latest/examples/python/graph_lattice?speculative-link). +[on GitHub](https://github.com/rerun-io/rerun/blob/latest/examples/python/graph_lattice). """.strip() diff --git a/examples/python/graphs/README.md b/examples/python/graphs/README.md index b06d813bd166..2d855c9cb919 100644 --- a/examples/python/graphs/README.md +++ b/examples/python/graphs/README.md @@ -25,8 +25,8 @@ This example shows different types of layouts: ## Used Rerun types -[`GraphNodes`](https://www.rerun.io/docs/reference/types/archetypes/graph_nodes?speculative-link), -[`GraphEdges`](https://www.rerun.io/docs/reference/types/archetypes/graph_edges?speculative-link) +[`GraphNodes`](https://www.rerun.io/docs/reference/types/archetypes/graph_nodes), +[`GraphEdges`](https://www.rerun.io/docs/reference/types/archetypes/graph_edges) ## Force-based layouts diff --git a/examples/python/graphs/graphs.py b/examples/python/graphs/graphs.py index 3bf490c625d9..9b1abf9c6acc 100644 --- a/examples/python/graphs/graphs.py +++ b/examples/python/graphs/graphs.py @@ -37,7 +37,7 @@ You can modify how these graphs look by changing the parameters of the force-based layout algorithm in the selection panel. The full source code for this example is available -[on GitHub](https://github.com/rerun-io/rerun/blob/latest/examples/python/graphs?speculative-link). +[on GitHub](https://github.com/rerun-io/rerun/blob/latest/examples/python/graphs). """.strip() diff --git a/examples/rust/clock/Cargo.toml b/examples/rust/clock/Cargo.toml index 5ae76b30aa11..1d27cfce16ef 100644 --- a/examples/rust/clock/Cargo.toml +++ b/examples/rust/clock/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clock" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/custom_data_loader/Cargo.toml b/examples/rust/custom_data_loader/Cargo.toml index 7e589e7bb815..cbdf1c81a6b0 100644 --- a/examples/rust/custom_data_loader/Cargo.toml +++ b/examples/rust/custom_data_loader/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "custom_data_loader" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/custom_store_subscriber/Cargo.toml b/examples/rust/custom_store_subscriber/Cargo.toml index fd30e4da9fee..a1b110bc6c8f 100644 --- a/examples/rust/custom_store_subscriber/Cargo.toml +++ b/examples/rust/custom_store_subscriber/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "custom_store_subscriber" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/custom_view/Cargo.toml b/examples/rust/custom_view/Cargo.toml index 34550ed488c2..cc38521c6e30 100644 --- a/examples/rust/custom_view/Cargo.toml +++ b/examples/rust/custom_view/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "custom_view" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/dataframe_query/Cargo.toml b/examples/rust/dataframe_query/Cargo.toml index 474fd6126e48..004e0a4804a6 100644 --- a/examples/rust/dataframe_query/Cargo.toml +++ b/examples/rust/dataframe_query/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dataframe_query" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/dna/Cargo.toml b/examples/rust/dna/Cargo.toml index da3bcfab9222..8b023677ef44 100644 --- a/examples/rust/dna/Cargo.toml +++ b/examples/rust/dna/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dna" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/extend_viewer_ui/Cargo.toml b/examples/rust/extend_viewer_ui/Cargo.toml index a66c9cd4d3ba..633cdb891f63 100644 --- a/examples/rust/extend_viewer_ui/Cargo.toml +++ b/examples/rust/extend_viewer_ui/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "extend_viewer_ui" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/external_data_loader/Cargo.toml b/examples/rust/external_data_loader/Cargo.toml index e3a722f8811a..5eab8acb917c 100644 --- a/examples/rust/external_data_loader/Cargo.toml +++ b/examples/rust/external_data_loader/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rerun-loader-rust-file" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/graph_lattice/Cargo.toml b/examples/rust/graph_lattice/Cargo.toml index c7e6066db100..ca476d428b9e 100644 --- a/examples/rust/graph_lattice/Cargo.toml +++ b/examples/rust/graph_lattice/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "graph_lattice" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/graph_lattice/README.md b/examples/rust/graph_lattice/README.md index 0f3e4ea460f9..eaddac3f256d 100644 --- a/examples/rust/graph_lattice/README.md +++ b/examples/rust/graph_lattice/README.md @@ -17,8 +17,8 @@ Since no explicit positions are passed for the nodes, Rerun will layout the grap ## Used Rerun types -[`GraphNodes`](https://www.rerun.io/docs/reference/types/archetypes/graph_nodes?speculative-link), -[`GraphEdges`](https://www.rerun.io/docs/reference/types/archetypes/graph_edges?speculative-link) +[`GraphNodes`](https://www.rerun.io/docs/reference/types/archetypes/graph_nodes), +[`GraphEdges`](https://www.rerun.io/docs/reference/types/archetypes/graph_edges) ## Run the code diff --git a/examples/rust/incremental_logging/Cargo.toml b/examples/rust/incremental_logging/Cargo.toml index db74d0a49c33..f23f29eb4d35 100644 --- a/examples/rust/incremental_logging/Cargo.toml +++ b/examples/rust/incremental_logging/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "incremental_logging" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/log_file/Cargo.toml b/examples/rust/log_file/Cargo.toml index 394a14998dc4..517929141648 100644 --- a/examples/rust/log_file/Cargo.toml +++ b/examples/rust/log_file/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "log_file" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/minimal/Cargo.toml b/examples/rust/minimal/Cargo.toml index ce6e897d0647..2f42d214ca71 100644 --- a/examples/rust/minimal/Cargo.toml +++ b/examples/rust/minimal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minimal" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/minimal_options/Cargo.toml b/examples/rust/minimal_options/Cargo.toml index d1878b36aee8..263afae8696b 100644 --- a/examples/rust/minimal_options/Cargo.toml +++ b/examples/rust/minimal_options/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minimal_options" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/minimal_serve/Cargo.toml b/examples/rust/minimal_serve/Cargo.toml index 4d26d9fb3fff..323edd8656c3 100644 --- a/examples/rust/minimal_serve/Cargo.toml +++ b/examples/rust/minimal_serve/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minimal_serve" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/objectron/Cargo.toml b/examples/rust/objectron/Cargo.toml index 63d29919306f..fb1af36d4c16 100644 --- a/examples/rust/objectron/Cargo.toml +++ b/examples/rust/objectron/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "objectron" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/raw_mesh/Cargo.toml b/examples/rust/raw_mesh/Cargo.toml index 5a9e9d5f92ee..2e4aa045e57c 100644 --- a/examples/rust/raw_mesh/Cargo.toml +++ b/examples/rust/raw_mesh/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raw_mesh" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/shared_recording/Cargo.toml b/examples/rust/shared_recording/Cargo.toml index 03d8cf582784..d892dade3bb2 100644 --- a/examples/rust/shared_recording/Cargo.toml +++ b/examples/rust/shared_recording/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shared_recording" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/spawn_viewer/Cargo.toml b/examples/rust/spawn_viewer/Cargo.toml index 4aad9ef6e914..2b16517bf9b0 100644 --- a/examples/rust/spawn_viewer/Cargo.toml +++ b/examples/rust/spawn_viewer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spawn_viewer" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/stdio/Cargo.toml b/examples/rust/stdio/Cargo.toml index fa67940ed546..8966b236b5a3 100644 --- a/examples/rust/stdio/Cargo.toml +++ b/examples/rust/stdio/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stdio" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/examples/rust/template/Cargo.toml b/examples/rust/template/Cargo.toml index 72b822c1f89c..38c375a8ecf4 100644 --- a/examples/rust/template/Cargo.toml +++ b/examples/rust/template/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "template" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/pixi.lock b/pixi.lock index 704ab17f98a4..ad8fed5b1757 100644 --- a/pixi.lock +++ b/pixi.lock @@ -30286,8 +30286,8 @@ packages: - watchfiles ; extra == 'dev' - pypi: rerun_notebook name: rerun-notebook - version: 0.21.0a1+dev - sha256: 047bf251505a9b46f02e7f700fe4073247fa2c95f8dd36f6f2f628e0ade8c055 + version: 0.22.0a1+dev + sha256: 7e12a38063373d2b82c7eb731a3985d7646c0ecd59b5c6230a8a48955094b723 requires_dist: - anywidget - jupyter-ui-poll @@ -30362,8 +30362,8 @@ packages: requires_python: '>=3.8,<3.13' - pypi: rerun_py name: rerun-sdk - version: 0.21.0a1+dev - sha256: a2a848bd650eb5075582955b9dfcb9e4e43a5d1209ca7f053ceeed16ded0118a + version: 0.22.0a1+dev + sha256: 4a0b3da14f4aef104a2c3c4c8db24f35528b5b96590c282a5e52d53a96aea177 requires_dist: - attrs>=23.1.0 - numpy>=1.23 @@ -30371,7 +30371,7 @@ packages: - pyarrow>=14.0.2 - typing-extensions>=4.5 - pytest==7.1.2 ; extra == 'tests' - - rerun-notebook==0.21.0a1+dev ; extra == 'notebook' + - rerun-notebook==0.22.0a1+dev ; extra == 'notebook' requires_python: '>=3.8' editable: true - pypi: https://files.pythonhosted.org/packages/7b/44/4e421b96b67b2daff264473f7465db72fbdf36a07e05494f50300cc7b0c6/rfc3339_validator-0.1.4-py2.py3-none-any.whl diff --git a/rerun_cpp/src/rerun.hpp b/rerun_cpp/src/rerun.hpp index 8f4546fc4c01..4b2d4933db05 100644 --- a/rerun_cpp/src/rerun.hpp +++ b/rerun_cpp/src/rerun.hpp @@ -66,7 +66,6 @@ namespace rerun { using datatypes::RotationAxisAngle; using datatypes::TensorBuffer; using datatypes::TensorData; - using datatypes::TensorDimension; using datatypes::Vec2D; using datatypes::Vec3D; using datatypes::Vec4D; diff --git a/rerun_cpp/src/rerun/archetypes/ellipsoids3d.hpp b/rerun_cpp/src/rerun/archetypes/ellipsoids3d.hpp index b65fbb6419ee..b84f7c317287 100644 --- a/rerun_cpp/src/rerun/archetypes/ellipsoids3d.hpp +++ b/rerun_cpp/src/rerun/archetypes/ellipsoids3d.hpp @@ -34,6 +34,61 @@ namespace rerun::archetypes { /// Note that orienting and placing the ellipsoids/spheres is handled via `[archetypes.InstancePoses3D]`. /// Some of its component are repeated here for convenience. /// If there's more instance poses than half sizes, the last half size will be repeated for the remaining poses. + /// + /// ## Example + /// + /// ### Covariance ellipsoid + /// ![image](https://static.rerun.io/elliopsoid3d_simple/bd5d46e61b80ae44792b52ee07d750a7137002ea/full.png) + /// + /// ```cpp + /// #include + /// + /// #include + /// #include + /// #include + /// + /// int main() { + /// const auto rec = rerun::RecordingStream("rerun_example_ellipsoid_simple"); + /// rec.spawn().exit_on_failure(); + /// + /// const float sigmas[3] = {5.0f, 3.0f, 1.0f}; + /// + /// std::default_random_engine gen; + /// std::normal_distribution dist(0.0, 1.0f); + /// + /// std::vector points3d(50000); + /// std::generate(points3d.begin(), points3d.end(), [&] { + /// return rerun::Position3D( + /// sigmas[0] * dist(gen), + /// sigmas[1] * dist(gen), + /// sigmas[2] * dist(gen) + /// ); + /// }); + /// + /// rec.log( + /// "points", + /// rerun::Points3D(points3d).with_radii(0.02f).with_colors(rerun::Rgba32(188, 77, 185)) + /// ); + /// + /// rec.log( + /// "ellipsoid", + /// rerun::Ellipsoids3D::from_centers_and_half_sizes( + /// { + /// {0.0f, 0.0f, 0.0f}, + /// {0.0f, 0.0f, 0.0f}, + /// }, + /// { + /// {sigmas[0], sigmas[1], sigmas[2]}, + /// {3.0f * sigmas[0], 3.0f * sigmas[1], 3.0f * sigmas[2]}, + /// } + /// ) + /// .with_colors({ + /// rerun::Rgba32(255, 255, 0), + /// rerun::Rgba32(64, 64, 0), + /// }) + /// ); + /// } + /// ``` struct Ellipsoids3D { /// For each ellipsoid, half of its size on its three axes. /// diff --git a/rerun_cpp/src/rerun/archetypes/graph_edges.hpp b/rerun_cpp/src/rerun/archetypes/graph_edges.hpp index a19940a3a351..7ae79b0a58b6 100644 --- a/rerun_cpp/src/rerun/archetypes/graph_edges.hpp +++ b/rerun_cpp/src/rerun/archetypes/graph_edges.hpp @@ -44,8 +44,6 @@ namespace rerun::archetypes { /// ); /// } /// ``` - /// - /// ⚠ **This is an experimental API! It is not fully supported, and is likely to change significantly in future versions.** struct GraphEdges { /// A list of node tuples. Collection edges; diff --git a/rerun_cpp/src/rerun/archetypes/graph_nodes.hpp b/rerun_cpp/src/rerun/archetypes/graph_nodes.hpp index 3ee519b9e729..6017a265a565 100644 --- a/rerun_cpp/src/rerun/archetypes/graph_nodes.hpp +++ b/rerun_cpp/src/rerun/archetypes/graph_nodes.hpp @@ -46,8 +46,6 @@ namespace rerun::archetypes { /// ); /// } /// ``` - /// - /// ⚠ **This is an experimental API! It is not fully supported, and is likely to change significantly in future versions.** struct GraphNodes { /// A list of node IDs. Collection node_ids; diff --git a/rerun_cpp/src/rerun/archetypes/tensor.hpp b/rerun_cpp/src/rerun/archetypes/tensor.hpp index 881c6f34bb60..8f2b553ab2c9 100644 --- a/rerun_cpp/src/rerun/archetypes/tensor.hpp +++ b/rerun_cpp/src/rerun/archetypes/tensor.hpp @@ -77,7 +77,7 @@ namespace rerun::archetypes { public: // START of extensions from tensor_ext.cpp: /// New Tensor from dimensions and tensor buffer. - Tensor(Collection shape, datatypes::TensorBuffer buffer) + Tensor(Collection shape, datatypes::TensorBuffer buffer) : Tensor(datatypes::TensorData(std::move(shape), std::move(buffer))) {} /// New tensor from dimensions and pointer to tensor data. @@ -88,7 +88,7 @@ namespace rerun::archetypes { /// \param data_ /// Target of the pointer must outlive the archetype. template - explicit Tensor(Collection shape, const TElement* data_) + explicit Tensor(Collection shape, const TElement* data_) : Tensor(datatypes::TensorData(std::move(shape), data_)) {} /// Update the `names` of the contained `TensorData` dimensions. diff --git a/rerun_cpp/src/rerun/archetypes/tensor_ext.cpp b/rerun_cpp/src/rerun/archetypes/tensor_ext.cpp index 850416c0bed9..d684252c1822 100644 --- a/rerun_cpp/src/rerun/archetypes/tensor_ext.cpp +++ b/rerun_cpp/src/rerun/archetypes/tensor_ext.cpp @@ -13,7 +13,7 @@ namespace rerun::archetypes { // /// New Tensor from dimensions and tensor buffer. - Tensor(Collection shape, datatypes::TensorBuffer buffer) + Tensor(Collection shape, datatypes::TensorBuffer buffer) : Tensor(datatypes::TensorData(std::move(shape), std::move(buffer))) {} /// New tensor from dimensions and pointer to tensor data. @@ -24,7 +24,7 @@ namespace rerun::archetypes { /// \param data_ /// Target of the pointer must outlive the archetype. template - explicit Tensor(Collection shape, const TElement* data_) + explicit Tensor(Collection shape, const TElement* data_) : Tensor(datatypes::TensorData(std::move(shape), data_)) {} /// Update the `names` of the contained `TensorData` dimensions. @@ -51,11 +51,7 @@ namespace rerun::archetypes { .handle(); } - auto new_shape = shape.to_vector(); - for (size_t i = 0; i < std::min(shape.size(), names.size()); ++i) { - new_shape[i].name = std::move(names[i]); - } - shape = std::move(new_shape); + this->data.data.names = std::move(names); return std::move(*this); } diff --git a/rerun_cpp/src/rerun/c/sdk_info.h b/rerun_cpp/src/rerun/c/sdk_info.h index d1e864f0498e..eb36492072a9 100644 --- a/rerun_cpp/src/rerun/c/sdk_info.h +++ b/rerun_cpp/src/rerun/c/sdk_info.h @@ -2,13 +2,13 @@ /// /// This should match the string returned by `rr_version_string` (C) or `rerun::version_string` (C++). /// If not, the SDK's binary and the C header are out of sync. -#define RERUN_SDK_HEADER_VERSION "0.21.0-alpha.1+dev" +#define RERUN_SDK_HEADER_VERSION "0.22.0-alpha.1+dev" /// Major version of the Rerun C SDK. #define RERUN_SDK_HEADER_VERSION_MAJOR 0 /// Minor version of the Rerun C SDK. -#define RERUN_SDK_HEADER_VERSION_MINOR 21 +#define RERUN_SDK_HEADER_VERSION_MINOR 22 /// Patch version of the Rerun C SDK. #define RERUN_SDK_HEADER_VERSION_PATCH 0 diff --git a/rerun_cpp/src/rerun/components/tensor_data.hpp b/rerun_cpp/src/rerun/components/tensor_data.hpp index d85bb7960091..a7ececf996fd 100644 --- a/rerun_cpp/src/rerun/components/tensor_data.hpp +++ b/rerun_cpp/src/rerun/components/tensor_data.hpp @@ -28,10 +28,7 @@ namespace rerun::components { /// /// \param shape Shape of the tensor. /// \param buffer The tensor buffer containing the tensor's data. - TensorData( - rerun::Collection shape, - rerun::datatypes::TensorBuffer buffer - ) + TensorData(rerun::Collection shape, rerun::datatypes::TensorBuffer buffer) : data(rerun::datatypes::TensorData(std::move(shape), std::move(buffer))) {} /// New tensor data from dimensions and pointer to tensor data. @@ -40,7 +37,7 @@ namespace rerun::components { /// \param shape Shape of the tensor. Determines the number of elements expected to be in `data_`. /// \param data_ Target of the pointer must outlive the archetype. template - explicit TensorData(Collection shape, const TElement* data_) + explicit TensorData(Collection shape, const TElement* data_) : data(rerun::datatypes::TensorData(std::move(shape), data_)) {} // END of extensions from tensor_data_ext.cpp, start of generated code: diff --git a/rerun_cpp/src/rerun/components/tensor_data_ext.cpp b/rerun_cpp/src/rerun/components/tensor_data_ext.cpp index 3da2dde1f4cf..3d797a51f227 100644 --- a/rerun_cpp/src/rerun/components/tensor_data_ext.cpp +++ b/rerun_cpp/src/rerun/components/tensor_data_ext.cpp @@ -11,7 +11,7 @@ namespace rerun::components { /// \param shape Shape of the tensor. /// \param buffer The tensor buffer containing the tensor's data. TensorData( - rerun::Collection shape, + rerun::Collection shape, rerun::datatypes::TensorBuffer buffer ) : data(rerun::datatypes::TensorData(std::move(shape), std::move(buffer))) {} @@ -22,7 +22,7 @@ namespace rerun::components { /// \param shape Shape of the tensor. Determines the number of elements expected to be in `data_`. /// \param data_ Target of the pointer must outlive the archetype. template - explicit TensorData(Collection shape, const TElement* data_) + explicit TensorData(Collection shape, const TElement* data_) : data(rerun::datatypes::TensorData(std::move(shape), data_)) {} // diff --git a/rerun_cpp/src/rerun/datatypes.hpp b/rerun_cpp/src/rerun/datatypes.hpp index 0d41f3d62a23..30807019b8a6 100644 --- a/rerun_cpp/src/rerun/datatypes.hpp +++ b/rerun_cpp/src/rerun/datatypes.hpp @@ -29,7 +29,6 @@ #include "datatypes/rotation_axis_angle.hpp" #include "datatypes/tensor_buffer.hpp" #include "datatypes/tensor_data.hpp" -#include "datatypes/tensor_dimension.hpp" #include "datatypes/tensor_dimension_index_selection.hpp" #include "datatypes/tensor_dimension_selection.hpp" #include "datatypes/time_int.hpp" diff --git a/rerun_cpp/src/rerun/datatypes/.gitattributes b/rerun_cpp/src/rerun/datatypes/.gitattributes index 46c43435cc8b..a571592c1e65 100644 --- a/rerun_cpp/src/rerun/datatypes/.gitattributes +++ b/rerun_cpp/src/rerun/datatypes/.gitattributes @@ -55,8 +55,6 @@ tensor_buffer.cpp linguist-generated=true tensor_buffer.hpp linguist-generated=true tensor_data.cpp linguist-generated=true tensor_data.hpp linguist-generated=true -tensor_dimension.cpp linguist-generated=true -tensor_dimension.hpp linguist-generated=true tensor_dimension_index_selection.cpp linguist-generated=true tensor_dimension_index_selection.hpp linguist-generated=true tensor_dimension_selection.cpp linguist-generated=true diff --git a/rerun_cpp/src/rerun/datatypes/tensor_data.cpp b/rerun_cpp/src/rerun/datatypes/tensor_data.cpp index dfaa17f489c0..0a53b1bec03d 100644 --- a/rerun_cpp/src/rerun/datatypes/tensor_data.cpp +++ b/rerun_cpp/src/rerun/datatypes/tensor_data.cpp @@ -4,7 +4,6 @@ #include "tensor_data.hpp" #include "tensor_buffer.hpp" -#include "tensor_dimension.hpp" #include #include @@ -14,15 +13,8 @@ namespace rerun::datatypes {} namespace rerun { const std::shared_ptr& Loggable::arrow_datatype() { static const auto datatype = arrow::struct_({ - arrow::field( - "shape", - arrow::list(arrow::field( - "item", - Loggable::arrow_datatype(), - false - )), - false - ), + arrow::field("shape", arrow::list(arrow::field("item", arrow::uint64(), false)), false), + arrow::field("names", arrow::list(arrow::field("item", arrow::utf8(), false)), true), arrow::field( "buffer", Loggable::arrow_datatype(), @@ -67,26 +59,41 @@ namespace rerun { { auto field_builder = static_cast(builder->field_builder(0)); - auto value_builder = static_cast(field_builder->value_builder()); + auto value_builder = static_cast(field_builder->value_builder()); ARROW_RETURN_NOT_OK(field_builder->Reserve(static_cast(num_elements))); ARROW_RETURN_NOT_OK(value_builder->Reserve(static_cast(num_elements * 2))); for (size_t elem_idx = 0; elem_idx < num_elements; elem_idx += 1) { const auto& element = elements[elem_idx]; ARROW_RETURN_NOT_OK(field_builder->Append()); - if (element.shape.data()) { - RR_RETURN_NOT_OK( - Loggable::fill_arrow_array_builder( - value_builder, - element.shape.data(), - element.shape.size() - ) - ); + ARROW_RETURN_NOT_OK(value_builder->AppendValues( + element.shape.data(), + static_cast(element.shape.size()), + nullptr + )); + } + } + { + auto field_builder = static_cast(builder->field_builder(1)); + auto value_builder = static_cast(field_builder->value_builder()); + ARROW_RETURN_NOT_OK(field_builder->Reserve(static_cast(num_elements))); + ARROW_RETURN_NOT_OK(value_builder->Reserve(static_cast(num_elements * 1))); + + for (size_t elem_idx = 0; elem_idx < num_elements; elem_idx += 1) { + const auto& element = elements[elem_idx]; + if (element.names.has_value()) { + ARROW_RETURN_NOT_OK(field_builder->Append()); + for (size_t item_idx = 0; item_idx < element.names.value().size(); + item_idx += 1) { + ARROW_RETURN_NOT_OK(value_builder->Append(element.names.value()[item_idx])); + } + } else { + ARROW_RETURN_NOT_OK(field_builder->AppendNull()); } } } { - auto field_builder = static_cast(builder->field_builder(1)); + auto field_builder = static_cast(builder->field_builder(2)); ARROW_RETURN_NOT_OK(field_builder->Reserve(static_cast(num_elements))); for (size_t elem_idx = 0; elem_idx < num_elements; elem_idx += 1) { RR_RETURN_NOT_OK(Loggable::fill_arrow_array_builder( diff --git a/rerun_cpp/src/rerun/datatypes/tensor_data.hpp b/rerun_cpp/src/rerun/datatypes/tensor_data.hpp index b09aae93f06b..5822b81be239 100644 --- a/rerun_cpp/src/rerun/datatypes/tensor_data.hpp +++ b/rerun_cpp/src/rerun/datatypes/tensor_data.hpp @@ -7,10 +7,11 @@ #include "../component_descriptor.hpp" #include "../result.hpp" #include "tensor_buffer.hpp" -#include "tensor_dimension.hpp" #include #include +#include +#include namespace arrow { class Array; @@ -28,8 +29,17 @@ namespace rerun::datatypes { /// These dimensions are combined with an index to look up values from the `buffer` field, /// which stores a contiguous array of typed values. struct TensorData { - /// The shape of the tensor, including optional names for each dimension. - rerun::Collection shape; + /// The shape of the tensor, i.e. the length of each dimension. + rerun::Collection shape; + + /// The names of the dimensions of the tensor (optional). + /// + /// If set, should be the same length as `datatypes::TensorData::shape`. + /// If it has a different length your names may show up improperly, + /// and some constructors may produce a warning or even an error. + /// + /// Example: `["height", "width", "channel", "batch"]`. + std::optional> names; /// The content/data. rerun::datatypes::TensorBuffer buffer; @@ -39,9 +49,7 @@ namespace rerun::datatypes { /// /// \param shape_ Shape of the tensor. /// \param buffer_ The tensor buffer containing the tensor's data. - TensorData( - Collection shape_, datatypes::TensorBuffer buffer_ - ) + TensorData(Collection shape_, datatypes::TensorBuffer buffer_) : shape(std::move(shape_)), buffer(std::move(buffer_)) {} /// New tensor data from dimensions and pointer to tensor data. @@ -50,11 +58,11 @@ namespace rerun::datatypes { /// \param shape_ Shape of the tensor. Determines the number of elements expected to be in `data`. /// \param data Target of the pointer must outlive the archetype. template - explicit TensorData(Collection shape_, const TElement* data) + explicit TensorData(Collection shape_, const TElement* data) : shape(std::move(shape_)) { size_t num_elements = shape.empty() ? 0 : 1; for (const auto& dim : shape) { - num_elements *= dim.size; + num_elements *= dim; } buffer = rerun::Collection::borrow(data, num_elements); } diff --git a/rerun_cpp/src/rerun/datatypes/tensor_data_ext.cpp b/rerun_cpp/src/rerun/datatypes/tensor_data_ext.cpp index 2c0aa306117b..a7a6c0fda766 100644 --- a/rerun_cpp/src/rerun/datatypes/tensor_data_ext.cpp +++ b/rerun_cpp/src/rerun/datatypes/tensor_data_ext.cpp @@ -10,7 +10,7 @@ namespace rerun::datatypes { /// \param shape_ Shape of the tensor. /// \param buffer_ The tensor buffer containing the tensor's data. TensorData( - Collection shape_, datatypes::TensorBuffer buffer_ + Collection shape_, datatypes::TensorBuffer buffer_ ) : shape(std::move(shape_)), buffer(std::move(buffer_)) {} @@ -20,10 +20,10 @@ namespace rerun::datatypes { /// \param shape_ Shape of the tensor. Determines the number of elements expected to be in `data`. /// \param data Target of the pointer must outlive the archetype. template - explicit TensorData(Collection shape_, const TElement* data) : shape(std::move(shape_)) { + explicit TensorData(Collection shape_, const TElement* data) : shape(std::move(shape_)) { size_t num_elements = shape.empty() ? 0 : 1; for (const auto& dim : shape) { - num_elements *= dim.size; + num_elements *= dim; } buffer = rerun::Collection::borrow(data, num_elements); } diff --git a/rerun_cpp/src/rerun/datatypes/tensor_dimension.cpp b/rerun_cpp/src/rerun/datatypes/tensor_dimension.cpp deleted file mode 100644 index c58c45b1264a..000000000000 --- a/rerun_cpp/src/rerun/datatypes/tensor_dimension.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs -// Based on "crates/store/re_types/definitions/rerun/datatypes/tensor_dimension.fbs". - -#include "tensor_dimension.hpp" - -#include -#include - -namespace rerun::datatypes {} - -namespace rerun { - const std::shared_ptr& Loggable::arrow_datatype() { - static const auto datatype = arrow::struct_({ - arrow::field("size", arrow::uint64(), false), - arrow::field("name", arrow::utf8(), true), - }); - return datatype; - } - - Result> Loggable::to_arrow( - const datatypes::TensorDimension* instances, size_t num_instances - ) { - // TODO(andreas): Allow configuring the memory pool. - arrow::MemoryPool* pool = arrow::default_memory_pool(); - auto datatype = arrow_datatype(); - - ARROW_ASSIGN_OR_RAISE(auto builder, arrow::MakeBuilder(datatype, pool)) - if (instances && num_instances > 0) { - RR_RETURN_NOT_OK(Loggable::fill_arrow_array_builder( - static_cast(builder.get()), - instances, - num_instances - )); - } - std::shared_ptr array; - ARROW_RETURN_NOT_OK(builder->Finish(&array)); - return array; - } - - rerun::Error Loggable::fill_arrow_array_builder( - arrow::StructBuilder* builder, const datatypes::TensorDimension* elements, - size_t num_elements - ) { - if (builder == nullptr) { - return rerun::Error(ErrorCode::UnexpectedNullArgument, "Passed array builder is null."); - } - if (elements == nullptr) { - return rerun::Error( - ErrorCode::UnexpectedNullArgument, - "Cannot serialize null pointer to arrow array." - ); - } - - { - auto field_builder = static_cast(builder->field_builder(0)); - ARROW_RETURN_NOT_OK(field_builder->Reserve(static_cast(num_elements))); - for (size_t elem_idx = 0; elem_idx < num_elements; elem_idx += 1) { - ARROW_RETURN_NOT_OK(field_builder->Append(elements[elem_idx].size)); - } - } - { - auto field_builder = static_cast(builder->field_builder(1)); - ARROW_RETURN_NOT_OK(field_builder->Reserve(static_cast(num_elements))); - for (size_t elem_idx = 0; elem_idx < num_elements; elem_idx += 1) { - const auto& element = elements[elem_idx]; - if (element.name.has_value()) { - ARROW_RETURN_NOT_OK(field_builder->Append(element.name.value())); - } else { - ARROW_RETURN_NOT_OK(field_builder->AppendNull()); - } - } - } - ARROW_RETURN_NOT_OK(builder->AppendValues(static_cast(num_elements), nullptr)); - - return Error::ok(); - } -} // namespace rerun diff --git a/rerun_cpp/src/rerun/datatypes/tensor_dimension.hpp b/rerun_cpp/src/rerun/datatypes/tensor_dimension.hpp deleted file mode 100644 index 052ff23efffd..000000000000 --- a/rerun_cpp/src/rerun/datatypes/tensor_dimension.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs -// Based on "crates/store/re_types/definitions/rerun/datatypes/tensor_dimension.fbs". - -#pragma once - -#include "../component_descriptor.hpp" -#include "../result.hpp" - -#include -#include -#include -#include - -namespace arrow { - class Array; - class DataType; - class StructBuilder; -} // namespace arrow - -namespace rerun::datatypes { - /// **Datatype**: A single dimension within a multi-dimensional tensor. - struct TensorDimension { - /// The length of this dimension. - uint64_t size; - - /// The name of this dimension, e.g. "width", "height", "channel", "batch', …. - std::optional name; - - public: // START of extensions from tensor_dimension_ext.cpp: - /// Nameless dimension. - TensorDimension(size_t size_) : size(size_) {} - - /// Dimension with name. - TensorDimension(size_t size_, std::string name_) : size(size_), name(std::move(name_)) {} - - // END of extensions from tensor_dimension_ext.cpp, start of generated code: - - public: - TensorDimension() = default; - }; -} // namespace rerun::datatypes - -namespace rerun { - template - struct Loggable; - - /// \private - template <> - struct Loggable { - static constexpr ComponentDescriptor Descriptor = "rerun.datatypes.TensorDimension"; - - /// Returns the arrow data type this type corresponds to. - static const std::shared_ptr& arrow_datatype(); - - /// Serializes an array of `rerun::datatypes::TensorDimension` into an arrow array. - static Result> to_arrow( - const datatypes::TensorDimension* instances, size_t num_instances - ); - - /// Fills an arrow array builder with an array of this type. - static rerun::Error fill_arrow_array_builder( - arrow::StructBuilder* builder, const datatypes::TensorDimension* elements, - size_t num_elements - ); - }; -} // namespace rerun diff --git a/rerun_cpp/src/rerun/datatypes/tensor_dimension_ext.cpp b/rerun_cpp/src/rerun/datatypes/tensor_dimension_ext.cpp deleted file mode 100644 index 6699700c5ae9..000000000000 --- a/rerun_cpp/src/rerun/datatypes/tensor_dimension_ext.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include "tensor_dimension.hpp" - -// #define EDIT_EXTENSION - -namespace rerun { - namespace datatypes { - -#ifdef EDIT_EXTENSION - // - - /// Nameless dimension. - TensorDimension(size_t size_) : size(size_) {} - - /// Dimension with name. - TensorDimension(size_t size_, std::string name_) : size(size_), name(std::move(name_)) {} - - // -#endif - } // namespace datatypes -} // namespace rerun diff --git a/rerun_js/web-viewer-react/README.md b/rerun_js/web-viewer-react/README.md index 361b1d63f155..3b569a57ea11 100644 --- a/rerun_js/web-viewer-react/README.md +++ b/rerun_js/web-viewer-react/README.md @@ -35,7 +35,7 @@ export default function App() { ``` The `rrd` in the snippet above should be a URL pointing to either: -- A hosted `.rrd` file, such as +- A hosted `.rrd` file, such as - A WebSocket connection to the SDK opened via the [`serve`](https://www.rerun.io/docs/reference/sdk/operating-modes#serve) API If `rrd` is not set, the Viewer will display the same welcome screen as . diff --git a/rerun_js/web-viewer-react/package.json b/rerun_js/web-viewer-react/package.json index a3f9eb5734a1..2b296ea8b714 100644 --- a/rerun_js/web-viewer-react/package.json +++ b/rerun_js/web-viewer-react/package.json @@ -1,6 +1,6 @@ { "name": "@rerun-io/web-viewer-react", - "version": "0.21.0-alpha.1+dev", + "version": "0.22.0-alpha.1+dev", "description": "Embed the Rerun web viewer in your React app", "licenses": [ { @@ -39,7 +39,7 @@ "tsconfig.json" ], "dependencies": { - "@rerun-io/web-viewer": "0.21.0-alpha.1", + "@rerun-io/web-viewer": "0.22.0-alpha.1", "@types/react": "^18.2.33", "react": "^18.2.0" }, diff --git a/rerun_js/web-viewer/README.md b/rerun_js/web-viewer/README.md index 7b714f3915a6..a9f0609f49e5 100644 --- a/rerun_js/web-viewer/README.md +++ b/rerun_js/web-viewer/README.md @@ -41,7 +41,7 @@ viewer.stop(); ``` The `rrd` in the snippet above should be a URL pointing to either: -- A hosted `.rrd` file, such as +- A hosted `.rrd` file, such as - A WebSocket connection to the SDK opened via the [`serve`](https://www.rerun.io/docs/reference/sdk/operating-modes#serve) API If `rrd` is not set, the Viewer will display the same welcome screen as . diff --git a/rerun_js/web-viewer/package.json b/rerun_js/web-viewer/package.json index 4da306e5c0a6..2ee11bf4a1dd 100644 --- a/rerun_js/web-viewer/package.json +++ b/rerun_js/web-viewer/package.json @@ -1,6 +1,6 @@ { "name": "@rerun-io/web-viewer", - "version": "0.21.0-alpha.1+dev", + "version": "0.22.0-alpha.1+dev", "description": "Embed the Rerun web viewer in your app", "licenses": [ { diff --git a/rerun_notebook/pyproject.toml b/rerun_notebook/pyproject.toml index 52105c2c8d55..23ae9bdd7ae0 100644 --- a/rerun_notebook/pyproject.toml +++ b/rerun_notebook/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] name = "rerun-notebook" description = "Implementation helper for running rerun-sdk in notebooks" -version = "0.21.0-alpha.1+dev" +version = "0.22.0-alpha.1+dev" dependencies = ["anywidget", "jupyter-ui-poll"] readme = "README.md" keywords = ["rerun", "notebook"] diff --git a/rerun_py/README.md b/rerun_py/README.md index 92678ac6b1dc..d86ad3f7c513 100644 --- a/rerun_py/README.md +++ b/rerun_py/README.md @@ -89,3 +89,8 @@ While we try to keep the main branch usable at all times, it may be unstable occ ```sh pixi run -e py py-build && pixi run -e py py-test ``` + +# Running specific Python unit tests +```sh +pixi run -e py py-build && pixi run -e py pytest rerun_py/tests/unit/test_tensor.py +``` diff --git a/rerun_py/pyproject.toml b/rerun_py/pyproject.toml index fb430c0a825f..7c67fc68b6b0 100644 --- a/rerun_py/pyproject.toml +++ b/rerun_py/pyproject.toml @@ -33,7 +33,7 @@ text = "MIT OR Apache-2.0" [project.optional-dependencies] tests = ["pytest==7.1.2"] -notebook = ["rerun-notebook==0.21.0-alpha.1+dev"] +notebook = ["rerun-notebook==0.22.0-alpha.1+dev"] [project.urls] documentation = "https://www.rerun.io/docs" diff --git a/rerun_py/rerun_sdk/rerun/__init__.py b/rerun_py/rerun_sdk/rerun/__init__.py index ffa7ac282107..f396868fbd8e 100644 --- a/rerun_py/rerun_sdk/rerun/__init__.py +++ b/rerun_py/rerun_sdk/rerun/__init__.py @@ -9,8 +9,8 @@ import numpy as np -__version__ = "0.21.0-alpha.1+dev" -__version_info__ = (0, 21, 0, "alpha.1") +__version__ = "0.22.0-alpha.1+dev" +__version_info__ = (0, 22, 0, "alpha.1") if sys.version_info < (3, 9): warnings.warn( diff --git a/rerun_py/rerun_sdk/rerun/_validators.py b/rerun_py/rerun_sdk/rerun/_validators.py index 324a0799e440..1ea9535dc2cd 100644 --- a/rerun_py/rerun_sdk/rerun/_validators.py +++ b/rerun_py/rerun_sdk/rerun/_validators.py @@ -5,7 +5,7 @@ import numpy as np import numpy.typing as npt -from ._converters import to_np_float32, to_np_float64, to_np_uint32 +from ._converters import to_np_float32, to_np_float64, to_np_uint32, to_np_uint64 # This code is a straight port from Rust. @@ -67,6 +67,13 @@ def flat_np_uint32_array_from_array_like(data: Any, dimension: int) -> npt.NDArr return flat_np_array_from_array_like(array, dimension) +def flat_np_uint64_array_from_array_like(data: Any, dimension: int) -> npt.NDArray[np.uint64]: + """Converts to a flat uint numpy array from an arbitrary vector, validating for an expected dimensionality.""" + + array = to_np_uint64(data) + return flat_np_array_from_array_like(array, dimension) + + def flat_np_array_from_array_like(array: npt.NDArray[Any], dimension: int) -> npt.NDArray[Any]: """Converts to a flat numpy array from an arbitrary vector, validating for an expected dimensionality.""" diff --git a/rerun_py/rerun_sdk/rerun/archetypes/bar_chart_ext.py b/rerun_py/rerun_sdk/rerun/archetypes/bar_chart_ext.py index 20d1198e8b98..f066f3098749 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/bar_chart_ext.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/bar_chart_ext.py @@ -21,7 +21,7 @@ def values__field_converter_override(data: TensorDataArrayLike) -> TensorDataBat # TODO(jleibs): Doing this on raw arrow data is not great. Clean this up # once we coerce to a canonical non-arrow type. - shape_dims = tensor_data.as_arrow_array()[0][0].values.field(0).to_numpy() + shape_dims = tensor_data.as_arrow_array()[0][0].values.to_numpy() if len([d for d in shape_dims if d != 1]) != 1: _send_warning_or_raise( diff --git a/rerun_py/rerun_sdk/rerun/archetypes/ellipsoids3d.py b/rerun_py/rerun_sdk/rerun/archetypes/ellipsoids3d.py index 0b8b6b679faa..d96015a93802 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/ellipsoids3d.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/ellipsoids3d.py @@ -28,6 +28,40 @@ class Ellipsoids3D(Ellipsoids3DExt, Archetype): Note that orienting and placing the ellipsoids/spheres is handled via `[archetypes.InstancePoses3D]`. Some of its component are repeated here for convenience. If there's more instance poses than half sizes, the last half size will be repeated for the remaining poses. + + Example + ------- + ### Covariance ellipsoid: + ```python + import numpy as np + import rerun as rr + + rr.init("rerun_example_ellipsoid_simple", spawn=True) + + center = np.array([0, 0, 0]) + sigmas = np.array([5, 3, 1]) + points = np.random.randn(50_000, 3) * sigmas.reshape(1, -1) + + rr.log("points", rr.Points3D(points, radii=0.02, colors=[188, 77, 185])) + rr.log( + "ellipsoid", + rr.Ellipsoids3D( + centers=[center, center], + half_sizes=[sigmas, 3 * sigmas], + colors=[[255, 255, 0], [64, 64, 0]], + ), + ) + ``` +
+ + + + + + + +
+ """ # __init__ can be found in ellipsoids3d_ext.py diff --git a/rerun_py/rerun_sdk/rerun/archetypes/graph_edges.py b/rerun_py/rerun_sdk/rerun/archetypes/graph_edges.py index a1568b980108..9cc648521d64 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/graph_edges.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/graph_edges.py @@ -25,8 +25,6 @@ class GraphEdges(Archetype): By default, edges are undirected. - ⚠️ **This is an experimental API! It is not fully supported, and is likely to change significantly in future versions.** - Example ------- ### Simple directed graph: diff --git a/rerun_py/rerun_sdk/rerun/archetypes/graph_nodes.py b/rerun_py/rerun_sdk/rerun/archetypes/graph_nodes.py index 13426e12ae29..ad23e270e2dc 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/graph_nodes.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/graph_nodes.py @@ -23,8 +23,6 @@ class GraphNodes(Archetype): """ **Archetype**: A list of nodes in a graph with optional labels, colors, etc. - ⚠️ **This is an experimental API! It is not fully supported, and is likely to change significantly in future versions.** - Example ------- ### Simple directed graph: diff --git a/rerun_py/rerun_sdk/rerun/archetypes/tensor_ext.py b/rerun_py/rerun_sdk/rerun/archetypes/tensor_ext.py index 0ee17ce0edab..14531279ff6c 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/tensor_ext.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/tensor_ext.py @@ -18,7 +18,7 @@ def __init__( self: Any, data: TensorDataLike | TensorLike | None = None, *, - dim_names: Sequence[str | None] | None = None, + dim_names: Sequence[str] | None = None, value_range: Range1DLike | None = None, ): """ @@ -36,11 +36,11 @@ def __init__( ---------- self: The TensorData object to construct. - data: TensorDataLike | None + data: A TensorData object, or type that can be converted to a numpy array. - dim_names: Sequence[str] | None + dim_names: The names of the tensor dimensions when generating the shape from an array. - value_range: Sequence[float] | None + value_range: The range of values to use for colormapping. If not specified, the range will be estimated from the data. diff --git a/rerun_py/rerun_sdk/rerun/datatypes/.gitattributes b/rerun_py/rerun_sdk/rerun/datatypes/.gitattributes index dcfe4dfeec99..c3a9b1f6cc22 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/.gitattributes +++ b/rerun_py/rerun_sdk/rerun/datatypes/.gitattributes @@ -29,7 +29,6 @@ rgba32.py linguist-generated=true rotation_axis_angle.py linguist-generated=true tensor_buffer.py linguist-generated=true tensor_data.py linguist-generated=true -tensor_dimension.py linguist-generated=true tensor_dimension_index_selection.py linguist-generated=true tensor_dimension_selection.py linguist-generated=true time_int.py linguist-generated=true diff --git a/rerun_py/rerun_sdk/rerun/datatypes/__init__.py b/rerun_py/rerun_sdk/rerun/datatypes/__init__.py index 1cf1156f07c8..49397b6713b3 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/__init__.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/__init__.py @@ -39,7 +39,6 @@ ) from .tensor_buffer import TensorBuffer, TensorBufferArrayLike, TensorBufferBatch, TensorBufferLike from .tensor_data import TensorData, TensorDataArrayLike, TensorDataBatch, TensorDataLike -from .tensor_dimension import TensorDimension, TensorDimensionArrayLike, TensorDimensionBatch, TensorDimensionLike from .tensor_dimension_index_selection import ( TensorDimensionIndexSelection, TensorDimensionIndexSelectionArrayLike, @@ -185,14 +184,10 @@ "TensorDataArrayLike", "TensorDataBatch", "TensorDataLike", - "TensorDimension", - "TensorDimensionArrayLike", - "TensorDimensionBatch", "TensorDimensionIndexSelection", "TensorDimensionIndexSelectionArrayLike", "TensorDimensionIndexSelectionBatch", "TensorDimensionIndexSelectionLike", - "TensorDimensionLike", "TensorDimensionSelection", "TensorDimensionSelectionArrayLike", "TensorDimensionSelectionBatch", diff --git a/rerun_py/rerun_sdk/rerun/datatypes/tensor_data.py b/rerun_py/rerun_sdk/rerun/datatypes/tensor_data.py index fa8e1e8364a5..28e3f52c428f 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/tensor_data.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/tensor_data.py @@ -7,6 +7,7 @@ from typing import TYPE_CHECKING, Any, Sequence, Union +import numpy as np import numpy.typing as npt import pyarrow as pa from attrs import define, field @@ -15,6 +16,9 @@ from .._baseclasses import ( BaseBatch, ) +from .._converters import ( + to_np_uint64, +) from .tensor_data_ext import TensorDataExt __all__ = ["TensorData", "TensorDataArrayLike", "TensorDataBatch", "TensorDataLike"] @@ -46,8 +50,8 @@ class TensorData(TensorDataExt): # __init__ can be found in tensor_data_ext.py - shape: list[datatypes.TensorDimension] = field() - # The shape of the tensor, including optional names for each dimension. + shape: npt.NDArray[np.uint64] = field(converter=to_np_uint64) + # The shape of the tensor, i.e. the length of each dimension. # # (Docstring intentionally commented out to hide this field from the docs) @@ -56,6 +60,17 @@ class TensorData(TensorDataExt): # # (Docstring intentionally commented out to hide this field from the docs) + names: list[str] | None = field(default=None) + # The names of the dimensions of the tensor (optional). + # + # If set, should be the same length as [`datatypes.TensorData.shape`][rerun.datatypes.TensorData.shape]. + # If it has a different length your names may show up improperly, + # and some constructors may produce a warning or even an error. + # + # Example: `["height", "width", "channel", "batch"]`. + # + # (Docstring intentionally commented out to hide this field from the docs) + if TYPE_CHECKING: TensorDataLike = Union[TensorData, npt.ArrayLike] @@ -68,20 +83,10 @@ class TensorData(TensorDataExt): class TensorDataBatch(BaseBatch[TensorDataArrayLike]): _ARROW_DATATYPE = pa.struct([ pa.field( - "shape", - pa.list_( - pa.field( - "item", - pa.struct([ - pa.field("size", pa.uint64(), nullable=False, metadata={}), - pa.field("name", pa.utf8(), nullable=True, metadata={}), - ]), - nullable=False, - metadata={}, - ) - ), - nullable=False, - metadata={}, + "shape", pa.list_(pa.field("item", pa.uint64(), nullable=False, metadata={})), nullable=False, metadata={} + ), + pa.field( + "names", pa.list_(pa.field("item", pa.utf8(), nullable=False, metadata={})), nullable=True, metadata={} ), pa.field( "buffer", diff --git a/rerun_py/rerun_sdk/rerun/datatypes/tensor_data_ext.py b/rerun_py/rerun_sdk/rerun/datatypes/tensor_data_ext.py index 5d89c7f050fe..64dd756cf60e 100644 --- a/rerun_py/rerun_sdk/rerun/datatypes/tensor_data_ext.py +++ b/rerun_py/rerun_sdk/rerun/datatypes/tensor_data_ext.py @@ -8,6 +8,7 @@ import numpy.typing as npt import pyarrow as pa +from rerun._validators import flat_np_uint64_array_from_array_like from rerun.error_utils import _send_warning_or_raise from .._unions import build_dense_union @@ -20,7 +21,7 @@ def numpy(self, force: bool) -> npt.NDArray[Any]: ... if TYPE_CHECKING: - from . import TensorBufferLike, TensorDataArrayLike, TensorDataLike, TensorDimension, TensorDimensionLike + from . import TensorBufferLike, TensorDataArrayLike, TensorDataLike TensorLike = Union[TensorDataLike, TorchTensorLike] """Type helper for a tensor-like object that can be logged to Rerun.""" @@ -48,10 +49,10 @@ class TensorDataExt: def __init__( self: Any, *, - shape: Sequence[TensorDimensionLike] | None = None, + shape: Sequence[int] | None = None, buffer: TensorBufferLike | None = None, array: TensorLike | None = None, - dim_names: Sequence[str | None] | None = None, + dim_names: Sequence[str] | None = None, ) -> None: """ Construct a `TensorData` object. @@ -64,18 +65,18 @@ def __init__( Parameters ---------- - self: TensorData + self: The TensorData object to construct. - shape: Sequence[TensorDimensionLike] | None + shape: The shape of the tensor. If None, and an array is provided, the shape will be inferred from the shape of the array. - buffer: TensorBufferLike | None + buffer: The buffer of the tensor. If None, and an array is provided, the buffer will be generated from the array. - array: Tensor | None + array: A numpy array (or The array of the tensor. If None, the array will be inferred from the buffer. - dim_names: Sequence[str] | None - The names of the tensor dimensions when generating the shape from an array. + dim_names: + The names of the tensor dimensions. """ if array is None and buffer is None: @@ -84,10 +85,8 @@ def __init__( raise ValueError("Can only provide one of 'array' or 'buffer'") if buffer is not None and shape is None: raise ValueError("If 'buffer' is provided, 'shape' is also required") - if shape is not None and dim_names is not None: - raise ValueError("Can only provide one of 'shape' or 'names'") - from . import TensorBuffer, TensorDimension + from . import TensorBuffer from .tensor_data import _tensor_data__buffer__special_field_converter_override if shape is not None: @@ -101,7 +100,7 @@ def __init__( # If a shape we provided, it must match the array if resolved_shape: - shape_tuple = tuple(d.size for d in resolved_shape) + shape_tuple = tuple(d for d in resolved_shape) if shape_tuple != array.shape: _send_warning_or_raise( ( @@ -113,21 +112,10 @@ def __init__( resolved_shape = None if resolved_shape is None: - if dim_names: - if len(array.shape) != len(dim_names): - _send_warning_or_raise( - ( - f"len(array.shape) = {len(array.shape)} != " - + f"len(dim_names) = {len(dim_names)}. Dropping tensor dimension names." - ), - 2, - ) - resolved_shape = [TensorDimension(size, name) for size, name in zip(array.shape, dim_names)] # type: ignore[arg-type] - else: - resolved_shape = [TensorDimension(size) for size in array.shape] + resolved_shape = [size for size in array.shape] if resolved_shape is not None: - self.shape = resolved_shape + self.shape: npt.NDArray[np.uint64] = resolved_shape else: # This shouldn't be possible but typing can't figure it out raise ValueError("No shape provided.") @@ -137,7 +125,20 @@ def __init__( elif array is not None: self.buffer = TensorBuffer(array.flatten()) - expected_buffer_size = prod(d.size for d in self.shape) + self.names: list[str] | None = None + if dim_names: + if len(self.shape) == len(dim_names): + self.names = dim_names + else: + _send_warning_or_raise( + ( + f"len(shape) = {len(self.shape)} != " + + f"len(dim_names) = {len(dim_names)}. Ignoring tensor dimension names." + ), + 2, + ) + + expected_buffer_size = prod(d for d in self.shape) if len(self.buffer.inner) != expected_buffer_size: raise ValueError( f"Shape and buffer size do not match. {len(self.buffer.inner)} {self.shape}->{expected_buffer_size}" @@ -166,20 +167,26 @@ def native_to_pa_array_override(data: TensorDataArrayLike, data_type: pa.DataTyp data = TensorData(array=array) # Now build the actual arrow fields - shape = _build_shape_array(data.shape).cast(data_type.field("shape").type) + shape = pa.array([flat_np_uint64_array_from_array_like(data.shape, 1)], type=data_type.field("shape").type) buffer = _build_buffer_array(data.buffer) + if data.names is None: + names = pa.array([None], type=data_type.field("names").type) + else: + names = pa.array([data.names], type=data_type.field("names").type) + return pa.StructArray.from_arrays( [ shape, + names, buffer, ], - fields=[data_type.field("shape"), data_type.field("buffer")], + fields=data_type.fields, ).cast(data_type) def numpy(self: Any, force: bool) -> npt.NDArray[Any]: """Convert the TensorData back to a numpy array.""" - dims = [d.size for d in self.shape] + dims = [d for d in self.shape] return self.buffer.inner.reshape(dims) # type: ignore[no-any-return] @@ -188,26 +195,6 @@ def numpy(self: Any, force: bool) -> npt.NDArray[Any]: ################################################################################ -def _build_shape_array(dims: list[TensorDimension]) -> pa.Array: - from . import TensorDimensionBatch - - data_type = TensorDimensionBatch._ARROW_DATATYPE - - array = np.asarray([d.size for d in dims], dtype=np.uint64).flatten() - names = pa.array([d.name for d in dims], mask=[d is None for d in dims], type=data_type.field("name").type) - - return pa.ListArray.from_arrays( - offsets=[0, len(array)], - values=pa.StructArray.from_arrays( - [ - array, - names, - ], - fields=[data_type.field("size"), data_type.field("name")], - ), - ) - - DTYPE_MAP: Final[dict[npt.DTypeLike, str]] = { np.uint8: "U8", np.uint16: "U16", diff --git a/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension.py b/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension.py deleted file mode 100644 index 99b1b0977ec3..000000000000 --- a/rerun_py/rerun_sdk/rerun/datatypes/tensor_dimension.py +++ /dev/null @@ -1,71 +0,0 @@ -# DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/python/mod.rs -# Based on "crates/store/re_types/definitions/rerun/datatypes/tensor_dimension.fbs". - -# You can extend this class by creating a "TensorDimensionExt" class in "tensor_dimension_ext.py". - -from __future__ import annotations - -from typing import Any, Sequence, Union - -import pyarrow as pa -from attrs import define, field - -from .._baseclasses import ( - BaseBatch, -) -from .._converters import ( - str_or_none, -) - -__all__ = ["TensorDimension", "TensorDimensionArrayLike", "TensorDimensionBatch", "TensorDimensionLike"] - - -@define(init=False) -class TensorDimension: - """**Datatype**: A single dimension within a multi-dimensional tensor.""" - - def __init__(self: Any, size: int, name: str | None = None): - """ - Create a new instance of the TensorDimension datatype. - - Parameters - ---------- - size: - The length of this dimension. - name: - The name of this dimension, e.g. "width", "height", "channel", "batch', …. - - """ - - # You can define your own __init__ function as a member of TensorDimensionExt in tensor_dimension_ext.py - self.__attrs_init__(size=size, name=name) - - size: int = field(converter=int) - # The length of this dimension. - # - # (Docstring intentionally commented out to hide this field from the docs) - - name: str | None = field(default=None, converter=str_or_none) - # The name of this dimension, e.g. "width", "height", "channel", "batch', …. - # - # (Docstring intentionally commented out to hide this field from the docs) - - -TensorDimensionLike = TensorDimension -TensorDimensionArrayLike = Union[ - TensorDimension, - Sequence[TensorDimensionLike], -] - - -class TensorDimensionBatch(BaseBatch[TensorDimensionArrayLike]): - _ARROW_DATATYPE = pa.struct([ - pa.field("size", pa.uint64(), nullable=False, metadata={}), - pa.field("name", pa.utf8(), nullable=True, metadata={}), - ]) - - @staticmethod - def _native_to_pa_array(data: TensorDimensionArrayLike, data_type: pa.DataType) -> pa.Array: - raise NotImplementedError( - "Arrow serialization of TensorDimension not implemented: We lack codegen for arrow-serialization of general structs" - ) # You need to implement native_to_pa_array_override in tensor_dimension_ext.py diff --git a/rerun_py/tests/unit/test_tensor.py b/rerun_py/tests/unit/test_tensor.py index 34dbf4ab6923..b55f1d0ec3b2 100644 --- a/rerun_py/tests/unit/test_tensor.py +++ b/rerun_py/tests/unit/test_tensor.py @@ -6,7 +6,7 @@ import pytest import rerun as rr from rerun.components import TensorData, TensorDataBatch -from rerun.datatypes import TensorBuffer, TensorDataLike, TensorDimension +from rerun.datatypes import TensorBuffer, TensorDataLike rng = np.random.default_rng(12345) RANDOM_TENSOR_SOURCE = rng.uniform(0.0, 1.0, (8, 6, 3, 5)) @@ -15,12 +15,8 @@ TENSOR_DATA_INPUTS: list[TensorDataLike] = [ # Full explicit construction TensorData( - shape=[ - TensorDimension(8, name="a"), - TensorDimension(6, name="b"), - TensorDimension(3, name="c"), - TensorDimension(5, name="d"), - ], + shape=[8, 6, 3, 5], + dim_names=["a", "b", "c", "d"], buffer=TensorBuffer(RANDOM_TENSOR_SOURCE), ), # Implicit construction from ndarray @@ -33,14 +29,15 @@ TensorData(array=RANDOM_TENSOR_SOURCE, dim_names=["a", "b", "c", "d"]), ] -# 0 = shape -# 1 = buffer +SHAPE = 0 # Based on datatypes/tensor_data.fbs +NAMES = 1 # Based on datatypes/tensor_data.fbs +BUFFER = 2 # Based on datatypes/tensor_data.fbs CHECK_FIELDS: list[list[int]] = [ - [0, 1], - [1], - [1], - [0, 1], - [0, 1], + [SHAPE, NAMES, BUFFER], + [BUFFER], + [BUFFER], + [SHAPE, NAMES, BUFFER], + [SHAPE, NAMES, BUFFER], ] @@ -87,12 +84,8 @@ def test_bad_tensors() -> None: # Wrong size buffer for dimensions with pytest.raises(ValueError): TensorData( - shape=[ - TensorDimension(8, name="a"), - TensorDimension(6, name="b"), - TensorDimension(3, name="c"), - TensorDimension(4, name="d"), - ], + shape=[1, 2, 3], + dim_names=["a", "b", "c", "d"], buffer=RANDOM_TENSOR_SOURCE, ) @@ -108,11 +101,7 @@ def test_bad_tensors() -> None: # Shape disagrees with array with pytest.raises(ValueError): TensorData( - shape=[ - TensorDimension(8, name="a"), - TensorDimension(6, name="b"), - TensorDimension(5, name="c"), - TensorDimension(3, name="d"), - ], + shape=[1, 2, 3], + dim_names=["a", "b", "c", "d"], array=RANDOM_TENSOR_SOURCE, ) diff --git a/scripts/ci/crates.py b/scripts/ci/crates.py index 89079fe39e3d..e4e818286d0a 100755 --- a/scripts/ci/crates.py +++ b/scripts/ci/crates.py @@ -434,7 +434,7 @@ def publish_crate(crate: Crate, token: str, version: str, env: dict[str, Any]) - while True: try: cargo( - f"publish --quiet --token {token}", + f"publish --quiet --locked --token {token}", cwd=crate.path, env=env, dry_run=False, diff --git a/scripts/generate_changelog.py b/scripts/generate_changelog.py index 40556952af3d..61c58a418e0d 100755 --- a/scripts/generate_changelog.py +++ b/scripts/generate_changelog.py @@ -29,6 +29,7 @@ "abey79", "emilk", "gavrelina", + "grtlr", "jleibs", "jprochazk", "nikolausWest", diff --git a/tests/cpp/roundtrips/tensor/main.cpp b/tests/cpp/roundtrips/tensor/main.cpp index c1a218349a5f..98d367454b74 100644 --- a/tests/cpp/roundtrips/tensor/main.cpp +++ b/tests/cpp/roundtrips/tensor/main.cpp @@ -8,10 +8,10 @@ int main(int, char** argv) { const auto rec = rerun::RecordingStream("rerun_example_roundtrip_tensor"); rec.save(argv[1]).exit_on_failure(); - std::vector dimensions{{3, 4, 5, 6}}; + std::vector shape{{3, 4, 5, 6}}; std::vector data(360); std::generate(data.begin(), data.end(), [n = 0]() mutable { return n++; }); - rec.log("tensor", rerun::archetypes::Tensor(rerun::datatypes::TensorData{dimensions, data})); + rec.log("tensor", rerun::archetypes::Tensor(rerun::datatypes::TensorData{shape, data})); } diff --git a/tests/python/release_checklist/check_all_components_ui.py b/tests/python/release_checklist/check_all_components_ui.py index 0885c5010ccc..2819ee163442 100644 --- a/tests/python/release_checklist/check_all_components_ui.py +++ b/tests/python/release_checklist/check_all_components_ui.py @@ -218,7 +218,7 @@ def alternatives(self) -> list[Any] | None: rr.datatypes.TensorData(array=np.random.randint(0, 255, (5, 3, 6, 4), dtype=np.uint8)), rr.datatypes.TensorData( array=np.random.randint(0, 255, (5, 3, 6, 4), dtype=np.uint8), - dim_names=[None, "hello", None, "world"], + dim_names=["hello", "brave", "new", "world"], ), rr.datatypes.TensorData(array=np.random.randint(0, 255, (5, 3, 6, 4, 3), dtype=np.uint8)), ] diff --git a/tests/python/release_checklist/check_hover_select_reset.py b/tests/python/release_checklist/check_hover_select_reset.py index 253949bb0c7d..abcc498bac10 100644 --- a/tests/python/release_checklist/check_hover_select_reset.py +++ b/tests/python/release_checklist/check_hover_select_reset.py @@ -11,9 +11,6 @@ This checks whether different UIs behave correctly with hover and selection. -Known bugs: -* TODO(#5138): Hovering over text document views does not highlight the corresponding entity in the blueprint tree. - ### Hover For each of the views: * Hover the view and verify it shows up as highlighted in the blueprint tree.