Datasets:
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
robotics
embodied-ai
human-demonstration
egocentric-video
bimanual-manipulation
tactile-sensing
License:
Download player/runtime/python/Lib/site-packages/rerun/encodings/dvec2d.py from alinarus/MultimodalData: direct link, hf CLI and curl.
- Browser
- Download file 2.23 kB
-
https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/encodings/dvec2d.py
- Command line
-
hf download hf://datasets/alinarus/MultimodalData/player/runtime/python/Lib/site-packages/rerun/encodings/dvec2d.py
-
curl -L -o dvec2d.py https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/encodings/dvec2d.py
2.23 kB
| # DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/python/mod.rs | |
| # Based on "crates/build/re_type_definitions/rerun/encodings/dvec2d.def.rs". | |
| # You can extend this class by creating a "DVec2DExt" class in "dvec2d_ext.py". | |
| from __future__ import annotations | |
| from collections.abc import Sequence | |
| from typing import TYPE_CHECKING, Any | |
| import numpy as np | |
| import numpy.typing as npt | |
| import pyarrow as pa | |
| from attrs import define, field | |
| from .._baseclasses import ( | |
| BaseBatch, | |
| ) | |
| from .._converters import ( | |
| to_np_float64, | |
| ) | |
| from .._numpy_compatibility import asarray | |
| from .dvec2d_ext import DVec2DExt | |
| __all__ = ["DVec2D", "DVec2DArrayLike", "DVec2DBatch", "DVec2DLike"] | |
| class DVec2D(DVec2DExt): | |
| """**Encoding**: A double-precision vector in 2D space.""" | |
| def __init__(self: Any, xy: DVec2DLike) -> None: | |
| """Create a new instance of the DVec2D encoding.""" | |
| # You can define your own __init__ function as a member of DVec2DExt in dvec2d_ext.py | |
| self.__attrs_init__(xy=xy) | |
| xy: npt.NDArray[np.float64] = field(converter=to_np_float64) | |
| def __array__(self, dtype: npt.DTypeLike = None, copy: bool | None = None) -> npt.NDArray[Any]: | |
| # You can define your own __array__ function as a member of DVec2DExt in dvec2d_ext.py | |
| return asarray(self.xy, dtype=dtype, copy=copy) | |
| def __len__(self) -> int: | |
| # You can define your own __len__ function as a member of DVec2DExt in dvec2d_ext.py | |
| return len(self.xy) | |
| if TYPE_CHECKING: | |
| DVec2DLike = DVec2D | npt.NDArray[Any] | npt.ArrayLike | Sequence[float] | |
| """A type alias for any DVec2D-like object.""" | |
| else: | |
| DVec2DLike = Any | |
| DVec2DArrayLike = ( | |
| DVec2D | Sequence[DVec2DLike] | npt.NDArray[Any] | npt.ArrayLike | Sequence[Sequence[float]] | Sequence[float] | |
| ) | |
| """A type alias for any DVec2D-like array object.""" | |
| class DVec2DBatch(BaseBatch[DVec2DArrayLike]): | |
| _ARROW_DATATYPE = pa.list_(pa.field("item", pa.float64(), nullable=False, metadata={}), 2) | |
| def _native_to_pa_array(data: DVec2DArrayLike, data_type: pa.DataType) -> pa.Array: | |
| return DVec2DExt.native_to_pa_array_override(data, data_type) | |