File size: 534 Bytes
9ff4bea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from __future__ import annotations

from typing import TYPE_CHECKING

import pyarrow as pa

from .._validators import flat_np_int32_array_from_array_like

if TYPE_CHECKING:
    from . import IVec3DArrayLike


class IVec3DExt:
    """Extension for [IVec3D][rerun.encodings.IVec3D]."""

    @staticmethod
    def native_to_pa_array_override(data: IVec3DArrayLike, data_type: pa.DataType) -> pa.Array:
        points = flat_np_int32_array_from_array_like(data, 3)
        return pa.FixedSizeListArray.from_arrays(points, type=data_type)