Skip to content

Commit

Permalink
Use StrEnum in python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Nov 30, 2023
1 parent 10c7280 commit 4f8a144
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions webviz_ert/models/data_model.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
from enum import Enum
import sys

if sys.version_info < (3, 11):
from enum import Enum

class DataType(str, Enum):
class StrEnum(str, Enum):
pass

else:
from enum import StrEnum


class DataType(StrEnum):
RESPONSE = "resp"
PARAMETER = "param"
ENSEMBLE = "ens"


class AxisType(str, Enum):
class AxisType(StrEnum):
INDEX = "index"
TIMESTAMP = "timestamp"

0 comments on commit 4f8a144

Please sign in to comment.