Skip to content

Commit

Permalink
refactor: ensure enum members are unique (#71)
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 authored Dec 20, 2024
1 parent fa47cff commit 6c0ea2e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion t4_devkit/schema/name.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from __future__ import annotations

from enum import Enum
from enum import Enum, unique

__all__ = ("SchemaName",)


@unique
class SchemaName(str, Enum):
"""An enum to represent schema filenames.
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/schema/tables/sample_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from enum import Enum
from enum import Enum, unique
from typing import TYPE_CHECKING

from attrs import define, field
Expand All @@ -15,6 +15,7 @@
__all__ = ["SampleData", "FileFormat"]


@unique
class FileFormat(str, Enum):
"""An enum to represent file formats.
Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/schema/tables/sensor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from enum import Enum
from enum import Enum, unique

from attrs import define, field

Expand All @@ -11,6 +11,7 @@
__all__ = ("Sensor", "SensorModality")


@unique
class SensorModality(str, Enum):
"""An enum to represent sensor modalities.
Expand Down
4 changes: 3 additions & 1 deletion t4_devkit/schema/tables/vehicle_state.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from enum import Enum
from enum import Enum, unique

from attrs import define, field

Expand All @@ -11,6 +11,7 @@
__all__ = ["ShiftState", "IndicatorState", "Indicators", "AdditionalInfo", "VehicleState"]


@unique
class ShiftState(str, Enum):
"""An enum to represent gear shift state."""

Expand All @@ -23,6 +24,7 @@ class ShiftState(str, Enum):
NONE = "NONE"


@unique
class IndicatorState(str, Enum):
"""An enum to represent indicator state."""

Expand Down
3 changes: 2 additions & 1 deletion t4_devkit/schema/tables/visibility.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import warnings
from enum import Enum
from enum import Enum, unique

from attrs import define, field
from typing_extensions import Self
Expand All @@ -13,6 +13,7 @@
__all__ = ("Visibility", "VisibilityLevel")


@unique
class VisibilityLevel(str, Enum):
"""An enum to represent visibility levels.
Expand Down

0 comments on commit 6c0ea2e

Please sign in to comment.