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/_numpy_compatibility.py from alinarus/MultimodalData: direct link, hf CLI and curl.
- Browser
- Download file 856 Bytes
-
https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/_numpy_compatibility.py
- Command line
-
hf download hf://datasets/alinarus/MultimodalData/player/runtime/python/Lib/site-packages/rerun/_numpy_compatibility.py
-
curl -L -o _numpy_compatibility.py https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/_numpy_compatibility.py
856 Bytes
| """ | |
| Rerun only formally supports Numpy > 2. | |
| However there is ongoing community support for partial coverage with Numpy 1. | |
| These are utilities for that support. | |
| """ | |
| from __future__ import annotations | |
| from typing import Any | |
| import numpy as np | |
| import numpy.typing as npt | |
| IS_NUMPY_2 = int(np.__version__.split(".")[0]) >= 2 | |
| if not IS_NUMPY_2: | |
| import warnings | |
| warnings.warn( | |
| "numpy 1 detected. Rerun has only been tested with numpy 2.", | |
| DeprecationWarning, | |
| stacklevel=2, | |
| ) | |
| def asarray(item: Any, dtype: npt.DTypeLike = None, copy: bool | None = None) -> np.ndarray: | |
| """A compatibility wrapper around `np.asarray`.""" | |
| if IS_NUMPY_2: | |
| return np.asarray(item, dtype=dtype, copy=copy) | |
| if copy is not None: | |
| return np.array(item, dtype=dtype, copy=copy) | |
| return np.asarray(item, dtype=dtype) | |