diff --git a/rerun_py/rerun2/__init__.py b/rerun_py/rerun2/__init__.py index 4af2ecbe18f2..361383599ffe 100644 --- a/rerun_py/rerun2/__init__.py +++ b/rerun_py/rerun2/__init__.py @@ -1,3 +1,4 @@ # NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +from __future__ import annotations from rerun2.archetypes import Points2D # noqa: F401 diff --git a/rerun_py/rerun2/archetypes/__init__.py b/rerun_py/rerun2/archetypes/__init__.py index 3394020c5059..7254930a8feb 100644 --- a/rerun_py/rerun2/archetypes/__init__.py +++ b/rerun_py/rerun2/archetypes/__init__.py @@ -1,8 +1,8 @@ # NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +from __future__ import annotations # NOTE: # - we use fully qualified paths to prevent lazy circular imports # - `noqa F401` (unused import) everywhere because, while not strictly necessary, # these imports are very nice for end users. - from rerun2.archetypes.points2d import Points2D # noqa: F401 diff --git a/rerun_py/rerun2/archetypes/points2d.py b/rerun_py/rerun2/archetypes/points2d.py index 513e2cadeb9a..74dce96b4cc0 100644 --- a/rerun_py/rerun2/archetypes/points2d.py +++ b/rerun_py/rerun2/archetypes/points2d.py @@ -3,7 +3,6 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Optional from rerun2 import components @@ -17,12 +16,12 @@ class Points2D: All the actual 2D points that make up the point cloud. """ - radii: Optional[components.RadiusArray] = None + radii: components.RadiusArray | None = None """ Optional radii for the points, effectively turning them into circles. """ - colors: Optional[components.ColorArray] = None + colors: components.ColorArray | None = None """ Optional colors for the points. @@ -30,12 +29,12 @@ class Points2D: As either 0-1 floats or 0-255 integers, with separate alpha. """ - labels: Optional[components.LabelArray] = None + labels: components.LabelArray | None = None """ Optional text labels for the points. """ - draw_order: Optional[components.DrawOrderArray] = None + draw_order: components.DrawOrderArray | None = None """ An optional floating point value that specifies the 2D drawing order. Objects with higher values are drawn on top of those with lower values. @@ -43,14 +42,14 @@ class Points2D: The default for 2D points is 30.0. """ - class_ids: Optional[components.ClassIdArray] = None + class_ids: components.ClassIdArray | None = None """ Optional class Ids for the points. The class ID provides colors and labels if not specified explicitly. """ - keypoint_ids: Optional[components.KeypointIdArray] = None + keypoint_ids: components.KeypointIdArray | None = None """ Optional keypoint IDs for the points, identifying them within a class. @@ -62,7 +61,7 @@ class Points2D: detected skeleton. """ - instance_keys: Optional[components.InstanceKeyArray] = None + instance_keys: components.InstanceKeyArray | None = None """ Unique identifiers for each individual point in the batch. """ @@ -91,13 +90,13 @@ def __init__( self, points: components.Point2DArrayLike, *, - radii: Optional[components.RadiusArrayLike] = None, - colors: Optional[components.ColorArrayLike] = None, - labels: Optional[components.LabelArrayLike] = None, - draw_order: Optional[components.DrawOrderLike] = None, - class_ids: Optional[components.ClassIdArrayLike] = None, - keypoint_ids: Optional[components.KeypointIdArrayLike] = None, - instance_keys: Optional[components.InstanceKeyArrayLike] = None, + radii: components.RadiusArrayLike | None = None, + colors: components.ColorArrayLike | None = None, + labels: components.LabelArrayLike | None = None, + draw_order: components.DrawOrderLike | None = None, + class_ids: components.ClassIdArrayLike | None = None, + keypoint_ids: components.KeypointIdArrayLike | None = None, + instance_keys: components.InstanceKeyArrayLike | None = None, ) -> None: # Required components self.points = components.Point2DArray.from_similar(points) diff --git a/rerun_py/rerun2/components/__init__.py b/rerun_py/rerun2/components/__init__.py index 47e85a20362e..ea03cdf177fa 100644 --- a/rerun_py/rerun2/components/__init__.py +++ b/rerun_py/rerun2/components/__init__.py @@ -1,9 +1,5 @@ # NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. - -# NOTE: -# - we use fully qualified paths to prevent lazy circular imports -# - `noqa F401` (unused import) everywhere because, while not strictly necessary, -# these imports are very nice for end users. +from __future__ import annotations from rerun2.components.class_id import ClassId, ClassIdArray, ClassIdArrayLike, ClassIdLike, ClassIdType # noqa: F401 from rerun2.components.color import Color, ColorArray, ColorArrayLike, ColorLike, ColorType # noqa: F401 @@ -30,4 +26,9 @@ ) from rerun2.components.label import Label, LabelArray, LabelArrayLike, LabelLike, LabelType # noqa: F401 from rerun2.components.point2d import Point2D, Point2DArray, Point2DArrayLike, Point2DLike, Point2DType # noqa: F401 + +# NOTE: +# - we use fully qualified paths to prevent lazy circular imports +# - `noqa F401` (unused import) everywhere because, while not strictly necessary, +# these imports are very nice for end users. from rerun2.components.radius import Radius, RadiusArray, RadiusArrayLike, RadiusLike, RadiusType # noqa: F401 diff --git a/rerun_py/rerun2/components/class_id.py b/rerun_py/rerun2/components/class_id.py index bcab3bfd9468..0790824a3abb 100644 --- a/rerun_py/rerun2/components/class_id.py +++ b/rerun_py/rerun2/components/class_id.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Optional, Sequence, Union +from typing import Any, Sequence, Union import numpy as np import numpy.typing as npt @@ -56,7 +56,7 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray] class ClassIdArray(pa.ExtensionArray, ClassIdArrayExt): # type: ignore[misc] @staticmethod - def from_similar(data: Optional[ClassIdArrayLike]): + def from_similar(data: ClassIdArrayLike | None): if data is None: return ClassIdType().wrap_array(pa.array([], type=ClassIdType().storage_type)) else: diff --git a/rerun_py/rerun2/components/color.py b/rerun_py/rerun2/components/color.py index 39d4f2a7e388..8a2aaf78ba25 100644 --- a/rerun_py/rerun2/components/color.py +++ b/rerun_py/rerun2/components/color.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Optional, Sequence, Union +from typing import Any, Sequence, Union import numpy as np import numpy.typing as npt @@ -64,7 +64,7 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray] class ColorArray(pa.ExtensionArray, ColorArrayExt): # type: ignore[misc] @staticmethod - def from_similar(data: Optional[ColorArrayLike]): + def from_similar(data: ColorArrayLike | None): if data is None: return ColorType().wrap_array(pa.array([], type=ColorType().storage_type)) else: diff --git a/rerun_py/rerun2/components/draw_order.py b/rerun_py/rerun2/components/draw_order.py index 0e3252f5e586..daae24b3d236 100644 --- a/rerun_py/rerun2/components/draw_order.py +++ b/rerun_py/rerun2/components/draw_order.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Optional, Sequence, Union +from typing import Any, Sequence, Union import numpy as np import numpy.typing as npt @@ -62,7 +62,7 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray] class DrawOrderArray(pa.ExtensionArray, DrawOrderArrayExt): # type: ignore[misc] @staticmethod - def from_similar(data: Optional[DrawOrderArrayLike]): + def from_similar(data: DrawOrderArrayLike | None): if data is None: return DrawOrderType().wrap_array(pa.array([], type=DrawOrderType().storage_type)) else: diff --git a/rerun_py/rerun2/components/instance_key.py b/rerun_py/rerun2/components/instance_key.py index 3d997f353dce..e512f0a1e63b 100644 --- a/rerun_py/rerun2/components/instance_key.py +++ b/rerun_py/rerun2/components/instance_key.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Optional, Sequence, Union +from typing import Any, Sequence, Union import numpy as np import numpy.typing as npt @@ -54,7 +54,7 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray] class InstanceKeyArray(pa.ExtensionArray, InstanceKeyArrayExt): # type: ignore[misc] @staticmethod - def from_similar(data: Optional[InstanceKeyArrayLike]): + def from_similar(data: InstanceKeyArrayLike | None): if data is None: return InstanceKeyType().wrap_array(pa.array([], type=InstanceKeyType().storage_type)) else: diff --git a/rerun_py/rerun2/components/keypoint_id.py b/rerun_py/rerun2/components/keypoint_id.py index 4165291e310c..0fc8e01a4e69 100644 --- a/rerun_py/rerun2/components/keypoint_id.py +++ b/rerun_py/rerun2/components/keypoint_id.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Optional, Sequence, Union +from typing import Any, Sequence, Union import numpy as np import numpy.typing as npt @@ -63,7 +63,7 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray] class KeypointIdArray(pa.ExtensionArray, KeypointIdArrayExt): # type: ignore[misc] @staticmethod - def from_similar(data: Optional[KeypointIdArrayLike]): + def from_similar(data: KeypointIdArrayLike | None): if data is None: return KeypointIdType().wrap_array(pa.array([], type=KeypointIdType().storage_type)) else: diff --git a/rerun_py/rerun2/components/label.py b/rerun_py/rerun2/components/label.py index 066ee6fe4bc1..cc5742472725 100644 --- a/rerun_py/rerun2/components/label.py +++ b/rerun_py/rerun2/components/label.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Optional, Sequence, Union +from typing import Any, Sequence, Union import pyarrow as pa @@ -55,7 +55,7 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray] class LabelArray(pa.ExtensionArray, LabelArrayExt): # type: ignore[misc] @staticmethod - def from_similar(data: Optional[LabelArrayLike]): + def from_similar(data: LabelArrayLike | None): if data is None: return LabelType().wrap_array(pa.array([], type=LabelType().storage_type)) else: diff --git a/rerun_py/rerun2/components/point2d.py b/rerun_py/rerun2/components/point2d.py index 16915ada861a..9ede44339c5c 100644 --- a/rerun_py/rerun2/components/point2d.py +++ b/rerun_py/rerun2/components/point2d.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Optional, Sequence, Tuple, Union +from typing import Any, Sequence, Tuple, Union import numpy as np import numpy.typing as npt @@ -56,7 +56,7 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray] class Point2DArray(pa.ExtensionArray, Point2DArrayExt): # type: ignore[misc] @staticmethod - def from_similar(data: Optional[Point2DArrayLike]): + def from_similar(data: Point2DArrayLike | None): if data is None: return Point2DType().wrap_array(pa.array([], type=Point2DType().storage_type)) else: diff --git a/rerun_py/rerun2/components/radius.py b/rerun_py/rerun2/components/radius.py index 3a106cd14649..6003cb3cf4fe 100644 --- a/rerun_py/rerun2/components/radius.py +++ b/rerun_py/rerun2/components/radius.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Optional, Sequence, Union +from typing import Any, Sequence, Union import numpy as np import numpy.typing as npt @@ -54,7 +54,7 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray] class RadiusArray(pa.ExtensionArray, RadiusArrayExt): # type: ignore[misc] @staticmethod - def from_similar(data: Optional[RadiusArrayLike]): + def from_similar(data: RadiusArrayLike | None): if data is None: return RadiusType().wrap_array(pa.array([], type=RadiusType().storage_type)) else: diff --git a/rerun_py/rerun2/datatypes/__init__.py b/rerun_py/rerun2/datatypes/__init__.py index 862df0e03401..883bb0b2bb50 100644 --- a/rerun_py/rerun2/datatypes/__init__.py +++ b/rerun_py/rerun2/datatypes/__init__.py @@ -1,8 +1,8 @@ # NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +from __future__ import annotations # NOTE: # - we use fully qualified paths to prevent lazy circular imports # - `noqa F401` (unused import) everywhere because, while not strictly necessary, # these imports are very nice for end users. - from rerun2.datatypes.vec2d import Vec2D, Vec2DArray, Vec2DArrayLike, Vec2DLike, Vec2DType # noqa: F401 diff --git a/rerun_py/rerun2/datatypes/vec2d.py b/rerun_py/rerun2/datatypes/vec2d.py index e3712df10c20..5c15e8265205 100644 --- a/rerun_py/rerun2/datatypes/vec2d.py +++ b/rerun_py/rerun2/datatypes/vec2d.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any, Optional, Sequence, Union +from typing import Any, Sequence, Union import numpy as np import numpy.typing as npt @@ -56,7 +56,7 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray] class Vec2DArray(pa.ExtensionArray, Vec2DArrayExt): # type: ignore[misc] @staticmethod - def from_similar(data: Optional[Vec2DArrayLike]): + def from_similar(data: Vec2DArrayLike | None): if data is None: return Vec2DType().wrap_array(pa.array([], type=Vec2DType().storage_type)) else: