Skip to content

Commit

Permalink
freshly autogenerated python code for new py38+ style guide
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jun 12, 2023
1 parent 16fb932 commit daeec84
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 40 deletions.
1 change: 1 addition & 0 deletions rerun_py/rerun2/__init__.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion rerun_py/rerun2/archetypes/__init__.py
Original file line number Diff line number Diff line change
@@ -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
29 changes: 14 additions & 15 deletions rerun_py/rerun2/archetypes/points2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

from dataclasses import dataclass
from typing import Optional

from rerun2 import components

Expand All @@ -17,40 +16,40 @@ 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.
The colors are interpreted as RGB or RGBA in sRGB gamma-space,
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.
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.
Expand All @@ -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.
"""
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 6 additions & 5 deletions rerun_py/rerun2/components/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions rerun_py/rerun2/components/class_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/rerun2/components/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/rerun2/components/draw_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/rerun2/components/instance_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/rerun2/components/keypoint_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/rerun2/components/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/rerun2/components/point2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/rerun2/components/radius.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion rerun_py/rerun2/datatypes/__init__.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions rerun_py/rerun2/datatypes/vec2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit daeec84

Please sign in to comment.