From fb1880b4a6d395c5940b411c86546474fbfe974f Mon Sep 17 00:00:00 2001 From: unexcellent <> Date: Wed, 30 Oct 2024 10:00:26 +0100 Subject: [PATCH] docs: add field documentation for JSON classes --- raillabel/json_format/coordinate_system.py | 8 ++++++++ raillabel/json_format/element_data_pointer.py | 7 +++++++ raillabel/json_format/frame_interval.py | 3 +++ raillabel/json_format/transform_data.py | 3 +++ 4 files changed, 21 insertions(+) diff --git a/raillabel/json_format/coordinate_system.py b/raillabel/json_format/coordinate_system.py index 7af85e1..fbaa241 100644 --- a/raillabel/json_format/coordinate_system.py +++ b/raillabel/json_format/coordinate_system.py @@ -14,6 +14,14 @@ class JSONCoordinateSystem(BaseModel): """A 3D reference frame.""" children: list[str] + "List of children of this coordinate system." + parent: Literal["base", ""] + "This is the string UID of the parent coordinate system this coordinate system is referring to." + pose_wrt_parent: JSONTransformData + "The transformation with regards to the parent coordinate system." + type: Literal["sensor", "local"] + """This is a string that describes the type of the coordinate system, for example, 'local', + 'geo').""" diff --git a/raillabel/json_format/element_data_pointer.py b/raillabel/json_format/element_data_pointer.py index 0ac6623..48cfa14 100644 --- a/raillabel/json_format/element_data_pointer.py +++ b/raillabel/json_format/element_data_pointer.py @@ -20,5 +20,12 @@ class JSONElementDataPointer(BaseModel): """ attribute_pointers: dict[str, Literal["num", "text", "boolean", "vec"]] + """This is a JSON object which contains pointers to the attributes of the element data pointed by + this pointer. The attributes pointer keys shall be the 'name' of the attribute of the element + data this pointer points to.""" + frame_intervals: list[JSONFrameInterval] + "List of frame intervals of the element data pointed by this pointer." + type: Literal["bbox", "num", "poly2d", "poly3d", "cuboid", "vec"] + "Type of the element data pointed by this pointer." diff --git a/raillabel/json_format/frame_interval.py b/raillabel/json_format/frame_interval.py index 1c5e51c..cacd837 100644 --- a/raillabel/json_format/frame_interval.py +++ b/raillabel/json_format/frame_interval.py @@ -13,4 +13,7 @@ class JSONFrameInterval(BaseModel): """ start: int + "Initial frame number of the interval." + end: int + "Ending frame number of the interval." diff --git a/raillabel/json_format/transform_data.py b/raillabel/json_format/transform_data.py index b86f9f0..edf7c87 100644 --- a/raillabel/json_format/transform_data.py +++ b/raillabel/json_format/transform_data.py @@ -10,4 +10,7 @@ class JSONTransformData(BaseModel): """The translation and rotation of one coordinate system to another.""" translation: tuple[float, float, float] + "List of 4 values encoding a quaternion (x, y, z, w)." + quaternion: tuple[float, float, float, float] + "List of 3 values encoding the translation vector (x, y, z)"