From e9525719e2cdf0b332c740ad977aec4c5f5f158e Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 8 Jul 2024 09:34:54 +0200 Subject: [PATCH] Use "N-dimensional" instead of "rank-N" in docstrings and error messages (#6797) ### What * Closes https://github.com/rerun-io/rerun/issues/5254 ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/{{pr.number}}?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/{{pr.number}}?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! - [PR Build Summary](https://build.rerun.io/pr/{{pr.number}}) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`. --- .../definitions/rerun/archetypes/bar_chart.fbs | 2 +- .../definitions/rerun/archetypes/depth_image.fbs | 2 +- .../definitions/rerun/archetypes/image.fbs | 2 +- .../rerun/archetypes/segmentation_image.fbs | 2 +- crates/re_types/src/archetypes/bar_chart.rs | 2 +- crates/re_types/src/archetypes/depth_image.rs | 2 +- crates/re_types/src/archetypes/image.rs | 2 +- .../src/archetypes/segmentation_image.rs | 2 +- rerun_cpp/src/rerun/archetypes/bar_chart.hpp | 2 +- rerun_cpp/src/rerun/archetypes/depth_image.hpp | 8 ++++---- .../src/rerun/archetypes/depth_image_ext.cpp | 12 ++++++++---- rerun_cpp/src/rerun/archetypes/image.hpp | 8 ++++---- rerun_cpp/src/rerun/archetypes/image_ext.cpp | 16 ++++++++-------- .../src/rerun/archetypes/segmentation_image.hpp | 8 ++++---- .../rerun/archetypes/segmentation_image_ext.cpp | 12 ++++++++---- rerun_cpp/tests/archetypes/image.cpp | 10 +++++----- .../archetypes/segmentation_and_depth_image.cpp | 4 ++-- rerun_py/rerun_sdk/rerun/archetypes/bar_chart.py | 4 ++-- .../rerun_sdk/rerun/archetypes/depth_image.py | 4 ++-- rerun_py/rerun_sdk/rerun/archetypes/image.py | 4 ++-- .../rerun/archetypes/segmentation_image.py | 4 ++-- 21 files changed, 60 insertions(+), 52 deletions(-) diff --git a/crates/re_types/definitions/rerun/archetypes/bar_chart.fbs b/crates/re_types/definitions/rerun/archetypes/bar_chart.fbs index 7df87e0dc91f..d216ab76e7d4 100644 --- a/crates/re_types/definitions/rerun/archetypes/bar_chart.fbs +++ b/crates/re_types/definitions/rerun/archetypes/bar_chart.fbs @@ -18,7 +18,7 @@ table BarChart ( ) { // --- Required --- - /// The values. Should always be a rank-1 tensor. + /// The values. Should always be a 1-dimensional tensor (i.e. a vector). values: rerun.components.TensorData ("attr.rerun.component_required", required, order: 1000); // --- Optional --- diff --git a/crates/re_types/definitions/rerun/archetypes/depth_image.fbs b/crates/re_types/definitions/rerun/archetypes/depth_image.fbs index 6e8549f69a34..08bf46cb389a 100644 --- a/crates/re_types/definitions/rerun/archetypes/depth_image.fbs +++ b/crates/re_types/definitions/rerun/archetypes/depth_image.fbs @@ -25,7 +25,7 @@ table DepthImage ( ) { // --- Required --- - /// The depth-image data. Should always be a rank-2 tensor. + /// The depth-image data. Should always be a 2-dimensional tensor. data: rerun.components.TensorData ("attr.rerun.component_required", order: 1000); // --- Optional --- diff --git a/crates/re_types/definitions/rerun/archetypes/image.fbs b/crates/re_types/definitions/rerun/archetypes/image.fbs index ad229f4ed248..4c07cef1405f 100644 --- a/crates/re_types/definitions/rerun/archetypes/image.fbs +++ b/crates/re_types/definitions/rerun/archetypes/image.fbs @@ -40,7 +40,7 @@ table Image ( ) { // --- Required --- - /// The image data. Should always be a rank-2 or rank-3 tensor. + /// The image data. Should always be a 2- or 3-dimensional tensor. data: rerun.components.TensorData ("attr.rerun.component_required", order: 1000); // --- Optional --- diff --git a/crates/re_types/definitions/rerun/archetypes/segmentation_image.fbs b/crates/re_types/definitions/rerun/archetypes/segmentation_image.fbs index 0192776c1ec8..660aab8c65b8 100644 --- a/crates/re_types/definitions/rerun/archetypes/segmentation_image.fbs +++ b/crates/re_types/definitions/rerun/archetypes/segmentation_image.fbs @@ -33,7 +33,7 @@ table SegmentationImage ( ) { // --- Required --- - /// The image data. Should always be a rank-2 tensor. + /// The image data. Should always be a 2-dimensional tensor. data: rerun.components.TensorData ("attr.rerun.component_required", order: 1000); // --- Optional --- diff --git a/crates/re_types/src/archetypes/bar_chart.rs b/crates/re_types/src/archetypes/bar_chart.rs index 41b7e2f984e8..71ae07d0e2ed 100644 --- a/crates/re_types/src/archetypes/bar_chart.rs +++ b/crates/re_types/src/archetypes/bar_chart.rs @@ -52,7 +52,7 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// #[derive(Clone, Debug, PartialEq)] pub struct BarChart { - /// The values. Should always be a rank-1 tensor. + /// The values. Should always be a 1-dimensional tensor (i.e. a vector). pub values: crate::components::TensorData, /// The color of the bar chart diff --git a/crates/re_types/src/archetypes/depth_image.rs b/crates/re_types/src/archetypes/depth_image.rs index 6f1fc3943423..b6ed4e4e8694 100644 --- a/crates/re_types/src/archetypes/depth_image.rs +++ b/crates/re_types/src/archetypes/depth_image.rs @@ -69,7 +69,7 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// #[derive(Clone, Debug, PartialEq)] pub struct DepthImage { - /// The depth-image data. Should always be a rank-2 tensor. + /// The depth-image data. Should always be a 2-dimensional tensor. pub data: crate::components::TensorData, /// An optional floating point value that specifies how long a meter is in the native depth units. diff --git a/crates/re_types/src/archetypes/image.rs b/crates/re_types/src/archetypes/image.rs index ce0a0c0a25f6..66db89f05730 100644 --- a/crates/re_types/src/archetypes/image.rs +++ b/crates/re_types/src/archetypes/image.rs @@ -70,7 +70,7 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// #[derive(Clone, Debug, PartialEq)] pub struct Image { - /// The image data. Should always be a rank-2 or rank-3 tensor. + /// The image data. Should always be a 2- or 3-dimensional tensor. pub data: crate::components::TensorData, /// Opacity of the image, useful for layering several images. diff --git a/crates/re_types/src/archetypes/segmentation_image.rs b/crates/re_types/src/archetypes/segmentation_image.rs index 3b81ff6c6758..de1a14231625 100644 --- a/crates/re_types/src/archetypes/segmentation_image.rs +++ b/crates/re_types/src/archetypes/segmentation_image.rs @@ -74,7 +74,7 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// #[derive(Clone, Debug, PartialEq)] pub struct SegmentationImage { - /// The image data. Should always be a rank-2 tensor. + /// The image data. Should always be a 2-dimensional tensor. pub data: crate::components::TensorData, /// Opacity of the image, useful for layering the segmentation image on top of another image. diff --git a/rerun_cpp/src/rerun/archetypes/bar_chart.hpp b/rerun_cpp/src/rerun/archetypes/bar_chart.hpp index 4a69add9ebc2..10ae2e34ecfe 100644 --- a/rerun_cpp/src/rerun/archetypes/bar_chart.hpp +++ b/rerun_cpp/src/rerun/archetypes/bar_chart.hpp @@ -37,7 +37,7 @@ namespace rerun::archetypes { /// } /// ``` struct BarChart { - /// The values. Should always be a rank-1 tensor. + /// The values. Should always be a 1-dimensional tensor (i.e. a vector). rerun::components::TensorData values; /// The color of the bar chart diff --git a/rerun_cpp/src/rerun/archetypes/depth_image.hpp b/rerun_cpp/src/rerun/archetypes/depth_image.hpp index 2d0dc09220dc..2c753214e25c 100644 --- a/rerun_cpp/src/rerun/archetypes/depth_image.hpp +++ b/rerun_cpp/src/rerun/archetypes/depth_image.hpp @@ -73,7 +73,7 @@ namespace rerun::archetypes { /// } /// ``` struct DepthImage { - /// The depth-image data. Should always be a rank-2 tensor. + /// The depth-image data. Should always be a 2-dimensional tensor. rerun::components::TensorData data; /// An optional floating point value that specifies how long a meter is in the native depth units. @@ -117,7 +117,7 @@ namespace rerun::archetypes { /// New depth image from height/width and tensor buffer. /// /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2-dimensional /// Sets the dimension names to "height" and "width" if they are not specified. /// \param buffer /// The tensor buffer containing the depth image data. @@ -129,14 +129,14 @@ namespace rerun::archetypes { /// \param data_ /// The tensor buffer containing the depth image data. /// Sets the dimension names to "height" and "width" if they are not specified. - /// Calls `Error::handle()` if the shape is not rank 2. + /// Calls `Error::handle()` if the tensor is not 2-dimensional explicit DepthImage(components::TensorData data_); /// New depth image from dimensions and pointer to depth image data. /// /// Type must be one of the types supported by `rerun::datatypes::TensorData`. /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2-dimensional /// Sets the dimension names to "height", "width" and "channel" if they are not specified. /// Determines the number of elements expected to be in `data`. /// \param data_ diff --git a/rerun_cpp/src/rerun/archetypes/depth_image_ext.cpp b/rerun_cpp/src/rerun/archetypes/depth_image_ext.cpp index 13169d2d56db..25d1686a465d 100644 --- a/rerun_cpp/src/rerun/archetypes/depth_image_ext.cpp +++ b/rerun_cpp/src/rerun/archetypes/depth_image_ext.cpp @@ -3,6 +3,8 @@ #include "../collection_adapter_builtins.hpp" +#include + namespace rerun::archetypes { #ifdef EDIT_EXTENSION @@ -11,7 +13,7 @@ namespace rerun::archetypes { /// New depth image from height/width and tensor buffer. /// /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2-dimensional /// Sets the dimension names to "height" and "width" if they are not specified. /// \param buffer /// The tensor buffer containing the depth image data. @@ -23,14 +25,14 @@ namespace rerun::archetypes { /// \param data_ /// The tensor buffer containing the depth image data. /// Sets the dimension names to "height" and "width" if they are not specified. - /// Calls `Error::handle()` if the shape is not rank 2. + /// Calls `Error::handle()` if the tensor is not 2-dimensional explicit DepthImage(components::TensorData data_); /// New depth image from dimensions and pointer to depth image data. /// /// Type must be one of the types supported by `rerun::datatypes::TensorData`. /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2-dimensional /// Sets the dimension names to "height", "width" and "channel" if they are not specified. /// Determines the number of elements expected to be in `data`. /// \param data_ @@ -45,7 +47,9 @@ namespace rerun::archetypes { DepthImage::DepthImage(components::TensorData data_) : data(std::move(data_)) { auto& shape = data.data.shape; if (shape.size() != 2) { - Error(ErrorCode::InvalidTensorDimension, "Shape must be rank 2.").handle(); + std::stringstream ss; + ss << "Expected 2-dimensional tensor, got " << shape.size() << " dimensions."; + Error(ErrorCode::InvalidTensorDimension, ss.str()).handle(); return; } diff --git a/rerun_cpp/src/rerun/archetypes/image.hpp b/rerun_cpp/src/rerun/archetypes/image.hpp index b4bf8dad0031..747596c7880e 100644 --- a/rerun_cpp/src/rerun/archetypes/image.hpp +++ b/rerun_cpp/src/rerun/archetypes/image.hpp @@ -73,7 +73,7 @@ namespace rerun::archetypes { /// } /// ``` struct Image { - /// The image data. Should always be a rank-2 or rank-3 tensor. + /// The image data. Should always be a 2- or 3-dimensional tensor. rerun::components::TensorData data; /// Opacity of the image, useful for layering several images. @@ -98,7 +98,7 @@ namespace rerun::archetypes { /// New Image from height/width/channel and tensor buffer. /// /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2 or 3. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2- or 3-dimensional. /// Sets the dimension names to "height", "width" and "channel" if they are not specified. /// \param buffer /// The tensor buffer containing the image data. @@ -110,14 +110,14 @@ namespace rerun::archetypes { /// \param data_ /// The tensor buffer containing the image data. /// Sets the dimension names to "height", "width" and "channel" if they are not specified. - /// Calls `Error::handle()` if the shape is not rank 2 or 3. + /// Calls `Error::handle()` if the tensor is not 2- or 3-dimensional. explicit Image(rerun::components::TensorData data_); /// New image from dimensions and pointer to image data. /// /// Type must be one of the types supported by `rerun::datatypes::TensorData`. /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2 or 3. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2- or 3-dimensional. /// Sets the dimension names to "height", "width" and "channel" if they are not specified. /// Determines the number of elements expected to be in `data`. /// \param data_ diff --git a/rerun_cpp/src/rerun/archetypes/image_ext.cpp b/rerun_cpp/src/rerun/archetypes/image_ext.cpp index 38b4117ba727..95d3fff74bf0 100644 --- a/rerun_cpp/src/rerun/archetypes/image_ext.cpp +++ b/rerun_cpp/src/rerun/archetypes/image_ext.cpp @@ -3,6 +3,8 @@ #include "../collection_adapter_builtins.hpp" +#include + // Uncomment for better auto-complete while editing the extension. // #define EDIT_EXTENSION @@ -14,7 +16,7 @@ namespace rerun::archetypes { /// New Image from height/width/channel and tensor buffer. /// /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2 or 3. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2- or 3-dimensional. /// Sets the dimension names to "height", "width" and "channel" if they are not specified. /// \param buffer /// The tensor buffer containing the image data. @@ -26,14 +28,14 @@ namespace rerun::archetypes { /// \param data_ /// The tensor buffer containing the image data. /// Sets the dimension names to "height", "width" and "channel" if they are not specified. - /// Calls `Error::handle()` if the shape is not rank 2 or 3. + /// Calls `Error::handle()` if the tensor is not 2- or 3-dimensional. explicit Image(rerun::components::TensorData data_); /// New image from dimensions and pointer to image data. /// /// Type must be one of the types supported by `rerun::datatypes::TensorData`. /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2 or 3. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2- or 3-dimensional. /// Sets the dimension names to "height", "width" and "channel" if they are not specified. /// Determines the number of elements expected to be in `data`. /// \param data_ @@ -48,11 +50,9 @@ namespace rerun::archetypes { Image::Image(rerun::components::TensorData data_) : data(std::move(data_)) { auto& shape = data.data.shape; if (shape.size() != 2 && shape.size() != 3) { - Error( - ErrorCode::InvalidTensorDimension, - "Image shape is expected to be either rank 2 or 3." - ) - .handle(); + std::stringstream ss; + ss << "Expected 2- or 3-dimensional tensor, got " << shape.size() << " dimensions."; + Error(ErrorCode::InvalidTensorDimension, ss.str()).handle(); return; } if (shape.size() == 3 && shape[2].size != 1 && shape[2].size != 3 && shape[2].size != 4) { diff --git a/rerun_cpp/src/rerun/archetypes/segmentation_image.hpp b/rerun_cpp/src/rerun/archetypes/segmentation_image.hpp index 7c865c717478..211c776fb26d 100644 --- a/rerun_cpp/src/rerun/archetypes/segmentation_image.hpp +++ b/rerun_cpp/src/rerun/archetypes/segmentation_image.hpp @@ -72,7 +72,7 @@ namespace rerun::archetypes { /// } /// ``` struct SegmentationImage { - /// The image data. Should always be a rank-2 tensor. + /// The image data. Should always be a 2-dimensional tensor. rerun::components::TensorData data; /// Opacity of the image, useful for layering the segmentation image on top of another image. @@ -98,7 +98,7 @@ namespace rerun::archetypes { /// New segmentation image from height/width and tensor buffer. /// /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2-dimensional /// Sets the dimension names to "height" and "width" if they are not specified. /// \param buffer /// The tensor buffer containing the segmentation image data. @@ -112,14 +112,14 @@ namespace rerun::archetypes { /// \param data_ /// The tensor buffer containing the segmentation image data. /// Sets the dimension names to "height" and "width" if they are not specified. - /// Calls `Error::handle()` if the shape is not rank 2. + /// Calls `Error::handle()` if the tensor is not 2-dimensional explicit SegmentationImage(components::TensorData data_); /// New segmentation image from dimensions and pointer to segmentation image data. /// /// Type must be one of the types supported by `rerun::datatypes::TensorData`. /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2-dimensional /// Sets the dimension names to "height", "width" and "channel" if they are not specified. /// Determines the number of elements expected to be in `data`. /// \param data_ diff --git a/rerun_cpp/src/rerun/archetypes/segmentation_image_ext.cpp b/rerun_cpp/src/rerun/archetypes/segmentation_image_ext.cpp index 1c64ed1c9263..eafb39b7f2d6 100644 --- a/rerun_cpp/src/rerun/archetypes/segmentation_image_ext.cpp +++ b/rerun_cpp/src/rerun/archetypes/segmentation_image_ext.cpp @@ -3,6 +3,8 @@ #include "../collection_adapter_builtins.hpp" #include "../error.hpp" +#include + namespace rerun::archetypes { #if 0 @@ -11,7 +13,7 @@ namespace rerun::archetypes { /// New segmentation image from height/width and tensor buffer. /// /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2-dimensional /// Sets the dimension names to "height" and "width" if they are not specified. /// \param buffer /// The tensor buffer containing the segmentation image data. @@ -23,14 +25,14 @@ namespace rerun::archetypes { /// \param data_ /// The tensor buffer containing the segmentation image data. /// Sets the dimension names to "height" and "width" if they are not specified. - /// Calls `Error::handle()` if the shape is not rank 2. + /// Calls `Error::handle()` if the tensor is not 2-dimensional explicit SegmentationImage(components::TensorData data_); /// New segmentation image from dimensions and pointer to segmentation image data. /// /// Type must be one of the types supported by `rerun::datatypes::TensorData`. /// \param shape - /// Shape of the image. Calls `Error::handle()` if the shape is not rank 2. + /// Shape of the image. Calls `Error::handle()` if the tensor is not 2-dimensional /// Sets the dimension names to "height", "width" and "channel" if they are not specified. /// Determines the number of elements expected to be in `data`. /// \param data_ @@ -45,7 +47,9 @@ namespace rerun::archetypes { SegmentationImage::SegmentationImage(components::TensorData data_) : data(std::move(data_)) { auto& shape = data.data.shape; if (shape.size() != 2) { - Error(ErrorCode::InvalidTensorDimension, "Shape must be rank 2.").handle(); + std::stringstream ss; + ss << "Expected 2-dimensional tensor, got " << shape.size() << " dimensions."; + Error(ErrorCode::InvalidTensorDimension, ss.str()).handle(); return; } diff --git a/rerun_cpp/tests/archetypes/image.cpp b/rerun_cpp/tests/archetypes/image.cpp index 316f697b8d29..9e67347a4e00 100644 --- a/rerun_cpp/tests/archetypes/image.cpp +++ b/rerun_cpp/tests/archetypes/image.cpp @@ -7,7 +7,7 @@ using namespace rerun::archetypes; #define TEST_TAG "[image][archetypes]" SCENARIO("Image archetype can be created from tensor data." TEST_TAG) { - GIVEN("tensor data with correct rank 2 shape") { + GIVEN("tensor data with correct 2-dimensional shape") { rerun::datatypes::TensorData data({3, 7}, std::vector(3 * 7, 0)); THEN("no error occurs on image construction") { auto image = check_logged_error([&] { return Image(std::move(data)); }); @@ -22,7 +22,7 @@ SCENARIO("Image archetype can be created from tensor data." TEST_TAG) { } } } - GIVEN("tensor data with correct rank 3 shape") { + GIVEN("tensor data with correct 3-dimensional shape") { rerun::datatypes::TensorData data({3, 7, 3}, std::vector(3 * 7 * 3, 0)); THEN("no error occurs on image construction") { auto image = check_logged_error([&] { return Image(std::move(data)); }); @@ -38,7 +38,7 @@ SCENARIO("Image archetype can be created from tensor data." TEST_TAG) { } } } - GIVEN("tensor data with incorrect rank 3 shape") { + GIVEN("tensor data with incorrect 3-dimensional shape") { rerun::datatypes::TensorData data({3, 7, 2}, std::vector(3 * 7 * 2, 0)); THEN("a warning occurs on image construction") { auto image = check_logged_error( @@ -72,7 +72,7 @@ SCENARIO("Image archetype can be created from tensor data." TEST_TAG) { } } - GIVEN("tensor data with too high rank") { + GIVEN("tensor data with too high dimensionality") { rerun::datatypes::TensorData data( { { @@ -103,7 +103,7 @@ SCENARIO("Image archetype can be created from tensor data." TEST_TAG) { } } - GIVEN("tensor data with too low rank") { + GIVEN("tensor data with too low dimensionality") { rerun::datatypes::TensorData data( { rerun::datatypes::TensorDimension(1, "dr robotnik"), diff --git a/rerun_cpp/tests/archetypes/segmentation_and_depth_image.cpp b/rerun_cpp/tests/archetypes/segmentation_and_depth_image.cpp index 0e85e97efbc7..8bb56cacaf28 100644 --- a/rerun_cpp/tests/archetypes/segmentation_and_depth_image.cpp +++ b/rerun_cpp/tests/archetypes/segmentation_and_depth_image.cpp @@ -46,7 +46,7 @@ void run_image_tests() { } } - GIVEN("tensor data with too high rank") { + GIVEN("tensor data with too high dimensionality") { rerun::datatypes::TensorData data( { { @@ -75,7 +75,7 @@ void run_image_tests() { } } - GIVEN("tensor data with too low rank") { + GIVEN("tensor data with too low dimensionality") { rerun::datatypes::TensorData data( { rerun::datatypes::TensorDimension(1, "dr robotnik"), diff --git a/rerun_py/rerun_sdk/rerun/archetypes/bar_chart.py b/rerun_py/rerun_sdk/rerun/archetypes/bar_chart.py index 7468e6393ed4..e3a57957f6ee 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/bar_chart.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/bar_chart.py @@ -54,7 +54,7 @@ def __init__(self: Any, values: datatypes.TensorDataLike, *, color: datatypes.Rg Parameters ---------- values: - The values. Should always be a rank-1 tensor. + The values. Should always be a 1-dimensional tensor (i.e. a vector). color: The color of the bar chart @@ -84,7 +84,7 @@ def _clear(cls) -> BarChart: metadata={"component": "required"}, converter=BarChartExt.values__field_converter_override, # type: ignore[misc] ) - # The values. Should always be a rank-1 tensor. + # The values. Should always be a 1-dimensional tensor (i.e. a vector). # # (Docstring intentionally commented out to hide this field from the docs) diff --git a/rerun_py/rerun_sdk/rerun/archetypes/depth_image.py b/rerun_py/rerun_sdk/rerun/archetypes/depth_image.py index f27b80f99fdd..cec9612d727b 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/depth_image.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/depth_image.py @@ -80,7 +80,7 @@ def __init__( Parameters ---------- data: - The depth-image data. Should always be a rank-2 tensor. + The depth-image data. Should always be a 2-dimensional tensor. meter: An optional floating point value that specifies how long a meter is in the native depth units. @@ -137,7 +137,7 @@ def _clear(cls) -> DepthImage: metadata={"component": "required"}, converter=DepthImageExt.data__field_converter_override, # type: ignore[misc] ) - # The depth-image data. Should always be a rank-2 tensor. + # The depth-image data. Should always be a 2-dimensional tensor. # # (Docstring intentionally commented out to hide this field from the docs) diff --git a/rerun_py/rerun_sdk/rerun/archetypes/image.py b/rerun_py/rerun_sdk/rerun/archetypes/image.py index 3fbb42b32c77..dd79c9fb29ce 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/image.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/image.py @@ -82,7 +82,7 @@ def __init__( Parameters ---------- data: - The image data. Should always be a rank-2 or rank-3 tensor. + The image data. Should always be a 2- or 3-dimensional tensor. opacity: Opacity of the image, useful for layering several images. @@ -119,7 +119,7 @@ def _clear(cls) -> Image: metadata={"component": "required"}, converter=ImageExt.data__field_converter_override, # type: ignore[misc] ) - # The image data. Should always be a rank-2 or rank-3 tensor. + # The image data. Should always be a 2- or 3-dimensional tensor. # # (Docstring intentionally commented out to hide this field from the docs) diff --git a/rerun_py/rerun_sdk/rerun/archetypes/segmentation_image.py b/rerun_py/rerun_sdk/rerun/archetypes/segmentation_image.py index 02bd2e8b9edd..bb72947e772c 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/segmentation_image.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/segmentation_image.py @@ -79,7 +79,7 @@ def __init__( Parameters ---------- data: - The image data. Should always be a rank-2 tensor. + The image data. Should always be a 2-dimensional tensor. opacity: Opacity of the image, useful for layering the segmentation image on top of another image. @@ -116,7 +116,7 @@ def _clear(cls) -> SegmentationImage: metadata={"component": "required"}, converter=SegmentationImageExt.data__field_converter_override, # type: ignore[misc] ) - # The image data. Should always be a rank-2 tensor. + # The image data. Should always be a 2-dimensional tensor. # # (Docstring intentionally commented out to hide this field from the docs)