Datasets:
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
robotics
embodied-ai
human-demonstration
egocentric-video
bimanual-manipulation
tactile-sensing
License:
File size: 766 Bytes
9ff4bea | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | from __future__ import annotations
from typing import TYPE_CHECKING
import pyarrow as pa
from .._validators import flat_np_float64_array_from_array_like
if TYPE_CHECKING:
from . import Range1DArrayLike
class Range1DExt:
"""Extension for [Range1D][rerun.encodings.Range1D]."""
@staticmethod
def native_to_pa_array_override(data: Range1DArrayLike, data_type: pa.DataType) -> pa.Array:
if isinstance(data, slice):
if data.step is not None and data.step != 1:
raise ValueError("Steps other than 1 are not supported for Range1D.")
data = [data.start, data.stop]
ranges = flat_np_float64_array_from_array_like(data, 2)
return pa.FixedSizeListArray.from_arrays(ranges, type=data_type)
|