Skip to content

Commit

Permalink
rebase yet again
Browse files Browse the repository at this point in the history
  • Loading branch information
zehiko committed Oct 14, 2024
1 parent e4d04e1 commit f6599b8
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 18 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/reusable_checks_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,10 @@ jobs:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}

- name: cargo test --all-targets --all-features
run: cargo test --all-targets --all-features
# Building with `--all-features` requires extra build tools like `nasm`.
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.25.0

- name: pixi run cargo test --all-targets --all-features
run: pixi run cargo test --all-targets --all-features
4 changes: 3 additions & 1 deletion crates/build/re_types_builder/src/codegen/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1995,9 +1995,11 @@ fn quote_arrow_serialization(
return Ok(unindent(
r##"
if isinstance(data, str):
array = [data]
array: Union[list[str], npt.ArrayLike] = [data]
elif isinstance(data, Sequence):
array = [str(datum) for datum in data]
elif isinstance(data, np.ndarray):
array = data
else:
array = [str(data)]
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_dataframe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_dataframe.svg)](https://crates.io/crates/re_dataframe)
[![Documentation](https://docs.rs/re_dataframe/badge.svg)](https://docs.rs/re_dataframe)
[![Documentation](https://docs.rs/re_dataframe/badge.svg)](https://docs.rs/re_dataframe?speculative-link)
![MIT](https://img.shields.io/badge/license-MIT-blue.svg)
![Apache](https://img.shields.io/badge/license-Apache-blue.svg)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace rerun.components;

/// Range of expected or valid values, specifying a lower and upper bound.
struct ValueRange (
"attr.docs.unreleased",
"attr.rust.derive": "Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable",
"attr.rust.repr": "transparent"
) {
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_types/definitions/rerun/datatypes/utf8.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace rerun.datatypes;
table Utf8 (
"attr.arrow.transparent",
"attr.python.aliases": "str",
"attr.python.array_aliases": "str, Sequence[str]",
"attr.python.array_aliases": "str, Sequence[str], npt.ArrayLike",
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord, Hash",
"attr.rust.override_crate": "re_types_core",
"attr.rust.repr": "transparent",
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_types/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ pub enum ColorPrimaries {
/// These are the same primaries we usually assume and use for all of Rerun's rendering
/// since they are the same primaries used by sRGB.
/// <https://en.wikipedia.org/wiki/Rec._709#Relationship_to_sRGB/>
/// The OETF/EOTF function (<https://en.wikipedia.org/wiki/Transfer_functions_in_imaging/>) is different,
/// The OETF/EOTF function (<https://en.wikipedia.org/wiki/Transfer_functions_in_imaging>) is different,
/// but for all other purposes they are the same.
/// (The only reason for us to convert to optical units ("linear" instead of "gamma") is for
/// lighting computation & tonemapping where we typically start out with sRGB anyways!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub enum ColorPrimaries {
/// These are the same primaries we usually assume and use for all our rendering
/// since they are the same primaries used by sRGB.
/// <https://en.wikipedia.org/wiki/Rec._709#Relationship_to_sRGB/>
/// The OETF/EOTF function (<https://en.wikipedia.org/wiki/Transfer_functions_in_imaging/>) is different,
/// The OETF/EOTF function (<https://en.wikipedia.org/wiki/Transfer_functions_in_imaging>) is different,
/// but for all other purposes they are the same.
/// (The only reason for us to convert to optical units ("linear" instead of "gamma") is for
/// lighting & tonemapping where we typically start out with an sRGB image!)
Expand Down
6 changes: 3 additions & 3 deletions docs/content/reference/types/components/value_range.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/content/reference/types/datatypes/range1d.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ exclude = [

# Needs authentication
'https://edge.meilisearch.com',
'https://eu.posthog.com/project/', # Requires to be logged in on PostHog.
'https://eu.posthog.com/project/', # Requires to be logged in on PostHog.
'https://github.com/rerun-io/internal-test-assets/\.*',

# Temporarily down or not accessible.
'https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html', # Nyud links are down every now and then.
Expand Down
6 changes: 5 additions & 1 deletion rerun_py/rerun_sdk/rerun/datatypes/entity_path.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions rerun_py/rerun_sdk/rerun/datatypes/utf8.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion rerun_py/tests/test_types/components/affix_fuzzer10.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion rerun_py/tests/test_types/components/affix_fuzzer9.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion rerun_py/tests/test_types/datatypes/string_component.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions rerun_py/tests/unit/test_utf8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from __future__ import annotations

import numpy as np
from rerun import datatypes


def test_utf8_batch_single() -> None:
single_string = "hello"
list_of_one_string = ["hello"]
array_of_one_string = np.array(["hello"])

assert (
datatypes.Utf8Batch(single_string).as_arrow_array() == datatypes.Utf8Batch(list_of_one_string).as_arrow_array()
)

assert (
datatypes.Utf8Batch(single_string).as_arrow_array() == datatypes.Utf8Batch(array_of_one_string).as_arrow_array()
)


def test_utf8_batch_many() -> None:
# different string length to be sure
list_of_strings = ["hell", "worlds"]
array_of_strings = np.array(["hell", "worlds"])

assert (
datatypes.Utf8Batch(list_of_strings).as_arrow_array() == datatypes.Utf8Batch(array_of_strings).as_arrow_array()
)

0 comments on commit f6599b8

Please sign in to comment.