Skip to content

Commit

Permalink
docs: add field documentation for JSON classes
Browse files Browse the repository at this point in the history
  • Loading branch information
unexcellent committed Oct 30, 2024
1 parent cf37c17 commit fb1880b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions raillabel/json_format/coordinate_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')."""
7 changes: 7 additions & 0 deletions raillabel/json_format/element_data_pointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
3 changes: 3 additions & 0 deletions raillabel/json_format/frame_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ class JSONFrameInterval(BaseModel):
"""

start: int
"Initial frame number of the interval."

end: int
"Ending frame number of the interval."
3 changes: 3 additions & 0 deletions raillabel/json_format/transform_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

0 comments on commit fb1880b

Please sign in to comment.