Skip to content

Commit

Permalink
feat: Add Issue class
Browse files Browse the repository at this point in the history
Co-authored-by: tklockau <[email protected]>
  • Loading branch information
nalquas and tklockau committed Dec 2, 2024
1 parent 5031276 commit 1ebbc05
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ test = [

[tool.ruff]
line-length = 101
target-version = "py310"

[tool.ruff.lint]
exclude = ["tests/*", "docs/*"]
Expand Down
3 changes: 2 additions & 1 deletion raillabel_providerkit/validation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# SPDX-License-Identifier: Apache-2.0
"""Package for validating raillabel data regarding the format requirements."""

from .issue import Issue, IssueIdentifiers, IssueType
from .validate_onthology.validate_onthology import validate_onthology
from .validate_schema import validate_schema

__all__ = ["validate_onthology", "validate_schema"]
__all__ = ["Issue", "IssueIdentifiers", "IssueType", "validate_onthology", "validate_schema"]
32 changes: 32 additions & 0 deletions raillabel_providerkit/validation/issue.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: Apache-2.0

from dataclasses import dataclass
from enum import Enum


class IssueType(Enum):
"""General classification of the issue."""

SCHEMA = "SchemaIssue"
EMPTY_FRAMES = "EmptyFramesIssue"
RAIL_SIDE = "RailSide"


@dataclass
class IssueIdentifiers:
"""Information for locating an issue."""

annotation: str | None = None
frame: str | None = None
object: str | None = None
sensor: str | None = None


@dataclass
class Issue:
"""An error that was found inside the scene."""

type: IssueType
reason: str
identifiers: IssueIdentifiers

0 comments on commit 1ebbc05

Please sign in to comment.