Skip to content

Commit

Permalink
rerun codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jun 28, 2023
1 parent 824bf22 commit 2033f3e
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 26 deletions.
2 changes: 1 addition & 1 deletion crates/re_types/source_hash.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a sha256 hash for all direct and indirect dependencies of this crate's build script.
# It can be safely removed at anytime to force the build script to run again.
# Check out build.rs to see how it's computed.
ba3dbc22cd914eac35c130d4bac2754a325ca5cd6e5154cd1511963b2bdc0769
c19f042ca7d4df439ce98030fdd82f4c8be1fec2f1046a525c48f4a91d5dc0e6
2 changes: 1 addition & 1 deletion crates/re_types/src/components/class_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub struct ClassId(pub u16);

impl crate::Component for ClassId {
fn name() -> crate::ComponentName {
crate::ComponentName::Borrowed("rerun.components.ClassId")
crate::ComponentName::Borrowed("rerun.class_id")
}

#[allow(clippy::wildcard_imports)]
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/src/components/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct Color(pub u32);

impl crate::Component for Color {
fn name() -> crate::ComponentName {
crate::ComponentName::Borrowed("rerun.components.Color")
crate::ComponentName::Borrowed("rerun.colorrgba")
}

#[allow(clippy::wildcard_imports)]
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/src/components/draw_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct DrawOrder(pub f32);

impl crate::Component for DrawOrder {
fn name() -> crate::ComponentName {
crate::ComponentName::Borrowed("rerun.components.DrawOrder")
crate::ComponentName::Borrowed("rerun.draw_order")
}

#[allow(clippy::wildcard_imports)]
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/src/components/instance_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct InstanceKey(pub u64);

impl crate::Component for InstanceKey {
fn name() -> crate::ComponentName {
crate::ComponentName::Borrowed("rerun.components.InstanceKey")
crate::ComponentName::Borrowed("rerun.instance_key")
}

#[allow(clippy::wildcard_imports)]
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/src/components/keypoint_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct KeypointId(pub u16);

impl crate::Component for KeypointId {
fn name() -> crate::ComponentName {
crate::ComponentName::Borrowed("rerun.components.KeypointId")
crate::ComponentName::Borrowed("rerun.keypoint_id")
}

#[allow(clippy::wildcard_imports)]
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/src/components/label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct Label(pub String);

impl crate::Component for Label {
fn name() -> crate::ComponentName {
crate::ComponentName::Borrowed("rerun.components.Label")
crate::ComponentName::Borrowed("rerun.label")
}

#[allow(clippy::wildcard_imports)]
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/src/components/point2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct Point2D {

impl crate::Component for Point2D {
fn name() -> crate::ComponentName {
crate::ComponentName::Borrowed("rerun.components.Point2D")
crate::ComponentName::Borrowed("rerun.point2d")
}

#[allow(clippy::wildcard_imports)]
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/src/components/radius.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct Radius(pub f32);

impl crate::Component for Radius {
fn name() -> crate::ComponentName {
crate::ComponentName::Borrowed("rerun.components.Radius")
crate::ComponentName::Borrowed("rerun.radius")
}

#[allow(clippy::wildcard_imports)]
Expand Down
5 changes: 3 additions & 2 deletions rerun_py/rerun_sdk/rerun/_rerun2/components/class_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __array__(self) -> npt.ArrayLike:

class ClassIdType(pa.ExtensionType): # type: ignore[misc]
def __init__(self: type[pa.ExtensionType]) -> None:
pa.ExtensionType.__init__(self, pa.uint16(), "rerun.components.ClassId")
pa.ExtensionType.__init__(self, pa.uint16(), "rerun.class_id")

def __arrow_ext_serialize__(self: type[pa.ExtensionType]) -> bytes:
# since we don't have a parameterized type, we don't need extra metadata to be deserialized
Expand All @@ -58,7 +58,8 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray]
return ClassIdArray


pa.register_extension_type(ClassIdType())
# TODO(cmc): bring back registration to pyarrow once legacy types are gone
# pa.register_extension_type(ClassIdType())


class ClassIdArray(pa.ExtensionArray, ClassIdArrayExt): # type: ignore[misc]
Expand Down
5 changes: 3 additions & 2 deletions rerun_py/rerun_sdk/rerun/_rerun2/components/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __array__(self) -> npt.ArrayLike:

class ColorType(pa.ExtensionType): # type: ignore[misc]
def __init__(self: type[pa.ExtensionType]) -> None:
pa.ExtensionType.__init__(self, pa.uint32(), "rerun.components.Color")
pa.ExtensionType.__init__(self, pa.uint32(), "rerun.colorrgba")

def __arrow_ext_serialize__(self: type[pa.ExtensionType]) -> bytes:
# since we don't have a parameterized type, we don't need extra metadata to be deserialized
Expand All @@ -67,7 +67,8 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray]
return ColorArray


pa.register_extension_type(ColorType())
# TODO(cmc): bring back registration to pyarrow once legacy types are gone
# pa.register_extension_type(ColorType())


class ColorArray(pa.ExtensionArray, ColorArrayExt): # type: ignore[misc]
Expand Down
5 changes: 3 additions & 2 deletions rerun_py/rerun_sdk/rerun/_rerun2/components/draw_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __array__(self) -> npt.ArrayLike:

class DrawOrderType(pa.ExtensionType): # type: ignore[misc]
def __init__(self: type[pa.ExtensionType]) -> None:
pa.ExtensionType.__init__(self, pa.float32(), "rerun.components.DrawOrder")
pa.ExtensionType.__init__(self, pa.float32(), "rerun.draw_order")

def __arrow_ext_serialize__(self: type[pa.ExtensionType]) -> bytes:
# since we don't have a parameterized type, we don't need extra metadata to be deserialized
Expand All @@ -59,7 +59,8 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray]
return DrawOrderArray


pa.register_extension_type(DrawOrderType())
# TODO(cmc): bring back registration to pyarrow once legacy types are gone
# pa.register_extension_type(DrawOrderType())


class DrawOrderArray(pa.ExtensionArray, DrawOrderArrayExt): # type: ignore[misc]
Expand Down
5 changes: 3 additions & 2 deletions rerun_py/rerun_sdk/rerun/_rerun2/components/instance_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __array__(self) -> npt.ArrayLike:

class InstanceKeyType(pa.ExtensionType): # type: ignore[misc]
def __init__(self: type[pa.ExtensionType]) -> None:
pa.ExtensionType.__init__(self, pa.uint64(), "rerun.components.InstanceKey")
pa.ExtensionType.__init__(self, pa.uint64(), "rerun.instance_key")

def __arrow_ext_serialize__(self: type[pa.ExtensionType]) -> bytes:
# since we don't have a parameterized type, we don't need extra metadata to be deserialized
Expand All @@ -51,7 +51,8 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray]
return InstanceKeyArray


pa.register_extension_type(InstanceKeyType())
# TODO(cmc): bring back registration to pyarrow once legacy types are gone
# pa.register_extension_type(InstanceKeyType())


class InstanceKeyArray(pa.ExtensionArray, InstanceKeyArrayExt): # type: ignore[misc]
Expand Down
5 changes: 3 additions & 2 deletions rerun_py/rerun_sdk/rerun/_rerun2/components/keypoint_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __array__(self) -> npt.ArrayLike:

class KeypointIdType(pa.ExtensionType): # type: ignore[misc]
def __init__(self: type[pa.ExtensionType]) -> None:
pa.ExtensionType.__init__(self, pa.uint16(), "rerun.components.KeypointId")
pa.ExtensionType.__init__(self, pa.uint16(), "rerun.keypoint_id")

def __arrow_ext_serialize__(self: type[pa.ExtensionType]) -> bytes:
# since we don't have a parameterized type, we don't need extra metadata to be deserialized
Expand All @@ -60,7 +60,8 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray]
return KeypointIdArray


pa.register_extension_type(KeypointIdType())
# TODO(cmc): bring back registration to pyarrow once legacy types are gone
# pa.register_extension_type(KeypointIdType())


class KeypointIdArray(pa.ExtensionArray, KeypointIdArrayExt): # type: ignore[misc]
Expand Down
5 changes: 3 additions & 2 deletions rerun_py/rerun_sdk/rerun/_rerun2/components/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __str__(self) -> str:

class LabelType(pa.ExtensionType): # type: ignore[misc]
def __init__(self: type[pa.ExtensionType]) -> None:
pa.ExtensionType.__init__(self, pa.utf8(), "rerun.components.Label")
pa.ExtensionType.__init__(self, pa.utf8(), "rerun.label")

def __arrow_ext_serialize__(self: type[pa.ExtensionType]) -> bytes:
# since we don't have a parameterized type, we don't need extra metadata to be deserialized
Expand All @@ -52,7 +52,8 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray]
return LabelArray


pa.register_extension_type(LabelType())
# TODO(cmc): bring back registration to pyarrow once legacy types are gone
# pa.register_extension_type(LabelType())


class LabelArray(pa.ExtensionArray, LabelArrayExt): # type: ignore[misc]
Expand Down
5 changes: 3 additions & 2 deletions rerun_py/rerun_sdk/rerun/_rerun2/components/point2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self: type[pa.ExtensionType]) -> None:
pa.ExtensionType.__init__(
self,
pa.struct([pa.field("x", pa.float32(), True, {}), pa.field("y", pa.float32(), True, {})]),
"rerun.components.Point2D",
"rerun.point2d",
)

def __arrow_ext_serialize__(self: type[pa.ExtensionType]) -> bytes:
Expand All @@ -53,7 +53,8 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray]
return Point2DArray


pa.register_extension_type(Point2DType())
# TODO(cmc): bring back registration to pyarrow once legacy types are gone
# pa.register_extension_type(Point2DType())


class Point2DArray(pa.ExtensionArray, Point2DArrayExt): # type: ignore[misc]
Expand Down
5 changes: 3 additions & 2 deletions rerun_py/rerun_sdk/rerun/_rerun2/components/radius.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __array__(self) -> npt.ArrayLike:

class RadiusType(pa.ExtensionType): # type: ignore[misc]
def __init__(self: type[pa.ExtensionType]) -> None:
pa.ExtensionType.__init__(self, pa.float32(), "rerun.components.Radius")
pa.ExtensionType.__init__(self, pa.float32(), "rerun.radius")

def __arrow_ext_serialize__(self: type[pa.ExtensionType]) -> bytes:
# since we don't have a parameterized type, we don't need extra metadata to be deserialized
Expand All @@ -51,7 +51,8 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray]
return RadiusArray


pa.register_extension_type(RadiusType())
# TODO(cmc): bring back registration to pyarrow once legacy types are gone
# pa.register_extension_type(RadiusType())


class RadiusArray(pa.ExtensionArray, RadiusArrayExt): # type: ignore[misc]
Expand Down
3 changes: 2 additions & 1 deletion rerun_py/rerun_sdk/rerun/_rerun2/datatypes/vec2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def __arrow_ext_class__(self: type[pa.ExtensionType]) -> type[pa.ExtensionArray]
return Vec2DArray


pa.register_extension_type(Vec2DType())
# TODO(cmc): bring back registration to pyarrow once legacy types are gone
# pa.register_extension_type(Vec2DType())


class Vec2DArray(pa.ExtensionArray, Vec2DArrayExt): # type: ignore[misc]
Expand Down

0 comments on commit 2033f3e

Please sign in to comment.