Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions t4_devkit/sanity/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ def is_error(self) -> bool:
class Checker(ABC):
"""Base class for sanity checkers."""

id: RuleID
name: RuleName
description: str
severity: Severity

def __init__(self, id: RuleID) -> None:
self.id = id

def __call__(self, context: SanityContext) -> Report:
match self.can_skip(context):
case Some(skip):
Expand Down
1 change: 1 addition & 0 deletions t4_devkit/sanity/format/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class FieldTypeChecker(Checker):
"""Base class for format checkers.

Attributes:
id (RuleID): The ID of the rule.
name (RuleName): The name of the rule.
severity (Severity): The severity of the rule.
description (str): The description of the rule.
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt001.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT001"]


@CHECKERS.register(RuleID("FMT001"))
@CHECKERS.register()
class FMT001(FieldTypeChecker):
"""A checker of FMT001."""

id = RuleID("FMT001")
name = RuleName("attribute-field")
severity = Severity.ERROR
description = "All types of 'Attribute' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt002.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT002"]


@CHECKERS.register(RuleID("FMT002"))
@CHECKERS.register()
class FMT002(FieldTypeChecker):
"""A checker of FMT002."""

id = RuleID("FMT002")
name = RuleName("calibrated-sensor-field")
severity = Severity.ERROR
description = "All types of 'CalibratedSensor' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt003.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT003"]


@CHECKERS.register(RuleID("FMT003"))
@CHECKERS.register()
class FMT003(FieldTypeChecker):
"""A checker of FMT003."""

id = RuleID("FMT003")
name = RuleName("category-field")
severity = Severity.ERROR
description = "All types of 'Category' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt004.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT004"]


@CHECKERS.register(RuleID("FMT004"))
@CHECKERS.register()
class FMT004(FieldTypeChecker):
"""A checker of FMT004."""

id = RuleID("FMT004")
name = RuleName("ego-pose-field")
severity = Severity.ERROR
description = "All types of 'EgoPose' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt005.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT005"]


@CHECKERS.register(RuleID("FMT005"))
@CHECKERS.register()
class FMT005(FieldTypeChecker):
"""A checker of FMT005."""

id = RuleID("FMT005")
name = RuleName("instance-field")
severity = Severity.ERROR
description = "All types of 'Instance' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt006.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT006"]


@CHECKERS.register(RuleID("FMT006"))
@CHECKERS.register()
class FMT006(FieldTypeChecker):
"""A checker of FMT006."""

id = RuleID("FMT006")
name = RuleName("log-field")
severity = Severity.ERROR
description = "All types of 'Log' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt007.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT007"]


@CHECKERS.register(RuleID("FMT007"))
@CHECKERS.register()
class FMT007(FieldTypeChecker):
"""A checker of FMT007."""

id = RuleID("FMT007")
name = RuleName("map-field")
severity = Severity.ERROR
description = "All types of 'Map' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt008.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT008"]


@CHECKERS.register(RuleID("FMT008"))
@CHECKERS.register()
class FMT008(FieldTypeChecker):
"""A checker of FMT008."""

id = RuleID("FMT008")
name = RuleName("sample-field")
severity = Severity.ERROR
description = "All types of 'Sample' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt009.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT009"]


@CHECKERS.register(RuleID("FMT009"))
@CHECKERS.register()
class FMT009(FieldTypeChecker):
"""A checker of FMT009."""

id = RuleID("FMT009")
name = RuleName("sample-annotation-field")
severity = Severity.ERROR
description = "All types of 'SampleAnnotation' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt010.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT010"]


@CHECKERS.register(RuleID("FMT010"))
@CHECKERS.register()
class FMT010(FieldTypeChecker):
"""A checker of FMT010."""

id = RuleID("FMT010")
name = RuleName("sample-data-field")
severity = Severity.ERROR
description = "All types of 'SampleData' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt011.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT011"]


@CHECKERS.register(RuleID("FMT011"))
@CHECKERS.register()
class FMT011(FieldTypeChecker):
"""A checker of FMT011."""

id = RuleID("FMT011")
name = RuleName("scene-field")
severity = Severity.ERROR
description = "All types of 'Scene' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt012.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT012"]


@CHECKERS.register(RuleID("FMT012"))
@CHECKERS.register()
class FMT012(FieldTypeChecker):
"""A checker of FMT012."""

id = RuleID("FMT012")
name = RuleName("sensor-field")
severity = Severity.ERROR
description = "All types of 'Sensor' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt013.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT013"]


@CHECKERS.register(RuleID("FMT013"))
@CHECKERS.register()
class FMT013(FieldTypeChecker):
"""A checker of FMT013."""

id = RuleID("FMT013")
name = RuleName("visibility-field")
severity = Severity.ERROR
description = "All types of 'Visibility' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt014.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT014"]


@CHECKERS.register(RuleID("FMT014"))
@CHECKERS.register()
class FMT014(FieldTypeChecker):
"""A checker of FMT014."""

id = RuleID("FMT014")
name = RuleName("lidarseg-field")
severity = Severity.ERROR
description = "All types of 'LidarSeg' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt015.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT015"]


@CHECKERS.register(RuleID("FMT015"))
@CHECKERS.register()
class FMT015(FieldTypeChecker):
"""A checker of FMT015."""

id = RuleID("FMT015")
name = RuleName("object-ann-field")
severity = Severity.ERROR
description = "All types of 'ObjectAnn' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt016.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT016"]


@CHECKERS.register(RuleID("FMT016"))
@CHECKERS.register()
class FMT016(FieldTypeChecker):
"""A checker of FMT016."""

id = RuleID("FMT016")
name = RuleName("surface-ann-field")
severity = Severity.ERROR
description = "All types of 'SurfaceAnn' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt017.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT017"]


@CHECKERS.register(RuleID("FMT017"))
@CHECKERS.register()
class FMT017(FieldTypeChecker):
"""A checker of FMT017."""

id = RuleID("FMT017")
name = RuleName("keypoint-field")
severity = Severity.ERROR
description = "All types of 'Keypoint' fields are valid."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/format/fmt018.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["FMT018"]


@CHECKERS.register(RuleID("FMT018"))
@CHECKERS.register()
class FMT018(FieldTypeChecker):
"""A checker of FMT018."""

id = RuleID("FMT018")
name = RuleName("vehicle-state-field")
severity = Severity.ERROR
description = "All types of 'VehicleState' fields are valid."
Expand Down
1 change: 1 addition & 0 deletions t4_devkit/sanity/record/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class RecordCountChecker(Checker):
"""Base class for record count checkers.

Attributes:
id (RuleID): The ID of the rule.
name (RuleName): The name of the rule.
severity (Severity): The severity of the rule.
description (str): The description of the rule.
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/record/rec001.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
__all__ = ["REC001"]


@CHECKERS.register(RuleID("REC001"))
@CHECKERS.register()
class REC001(RecordCountChecker):
"""A checker of REC001."""

id = RuleID("REC001")
name = RuleName("scene-single")
severity = Severity.ERROR
description = "'Scene' record is a single."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/record/rec002.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
__all__ = ["REC002"]


@CHECKERS.register(RuleID("REC002"))
@CHECKERS.register()
class REC002(RecordCountChecker):
"""A checker of REC002."""

id = RuleID("REC002")
name = RuleName("sample-not-empty")
severity = Severity.ERROR
description = "'Sample' record is not empty."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/record/rec003.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
__all__ = ["REC003"]


@CHECKERS.register(RuleID("REC003"))
@CHECKERS.register()
class REC003(RecordCountChecker):
"""A checker of REC003."""

id = RuleID("REC003")
name = RuleName("sample-data-not-empty")
severity = Severity.ERROR
description = "'SampleData' record is not empty."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/record/rec004.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
__all__ = ["REC004"]


@CHECKERS.register(RuleID("REC004"))
@CHECKERS.register()
class REC004(RecordCountChecker):
"""A checker of REC004."""

id = RuleID("REC004")
name = RuleName("ego-pose-not-empty")
severity = Severity.ERROR
description = "'EgoPose' record is not empty."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/record/rec005.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
__all__ = ["REC005"]


@CHECKERS.register(RuleID("REC005"))
@CHECKERS.register()
class REC005(RecordCountChecker):
"""A checker of REC005."""

id = RuleID("REC005")
name = RuleName("calibrated-sensor-not-empty")
severity = Severity.ERROR
description = "'CalibratedSensor' record is not empty."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/record/rec006.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
__all__ = ["REC006"]


@CHECKERS.register(RuleID("REC006"))
@CHECKERS.register()
class REC006(RecordCountChecker):
"""A checker of REC006."""

id = RuleID("REC006")
name = RuleName("instance-not-empty")
severity = Severity.ERROR
description = "'Instance' record is not empty."
Expand Down
1 change: 1 addition & 0 deletions t4_devkit/sanity/reference/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class RecordReferenceChecker(Checker):
"""Base class for record reference checkers.

Attributes:
id (RuleID): The ID of the rule.
name (RuleName): The name of the rule.
severity (Severity): The severity of the rule.
description (str): The description of the rule.
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/reference/ref001.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["REF001"]


@CHECKERS.register(RuleID("REF001"))
@CHECKERS.register()
class REF001(RecordReferenceChecker):
"""A checker of REF001."""

id = RuleID("REF001")
name = RuleName("scene-to-log")
severity = Severity.ERROR
description = "'Scene.log_token' refers to 'Log' record."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/reference/ref002.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["REF002"]


@CHECKERS.register(RuleID("REF002"))
@CHECKERS.register()
class REF002(RecordReferenceChecker):
"""A checker of REF002."""

id = RuleID("REF002")
name = RuleName("scene-to-first-sample")
severity = Severity.ERROR
description = "'Scene.first_sample_token' refers to 'Sample' record."
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/sanity/reference/ref003.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
__all__ = ["REF003"]


@CHECKERS.register(RuleID("REF003"))
@CHECKERS.register()
class REF003(RecordReferenceChecker):
"""A checker of REF003."""

id = RuleID("REF003")
name = RuleName("scene-to-last-sample")
severity = Severity.ERROR
description = "'Scene.last_sample_token' refers to 'Sample' record."
Expand Down
Loading
Loading