Skip to content

Commit

Permalink
fix missing marker size serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Feb 6, 2024
1 parent f4faefe commit c0a0026
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rerun_py/rerun_sdk/rerun/components/marker_size.py

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

18 changes: 18 additions & 0 deletions rerun_py/rerun_sdk/rerun/components/marker_size_ext.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import numpy as np
import pyarrow as pa

if TYPE_CHECKING:
from . import MarkerSizeArrayLike


class MarkerSizeExt:
"""Extension for [MarkerSize][rerun.components.MarkerSize]."""

@staticmethod
def native_to_pa_array_override(data: MarkerSizeArrayLike, data_type: pa.DataType) -> pa.Array:
array = np.asarray(data, dtype=np.float32).flatten()
return pa.array(array, type=data_type)

0 comments on commit c0a0026

Please sign in to comment.