Skip to content

Commit

Permalink
Add unique decorator to UnitEnum in units.py
Browse files Browse the repository at this point in the history
The 'unique' decorator from the enum library was added to the UnitEnum class to ensure uniqueness of enum members. This change helps to prevent potential issues arising from duplicate enum values in the future.
  • Loading branch information
tasansal committed Dec 4, 2023
1 parent b563565 commit 9e4603b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mdio/schemas/base/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@


from enum import Enum
from enum import unique

from pydantic import Field

from mdio.schemas.base.core import StrictCamelBaseModel


@unique
class UnitEnum(str, Enum):
"""An Enum representing units as strings, from pint."""

Expand Down

0 comments on commit 9e4603b

Please sign in to comment.