From 4f8a144f6b157e36454f629b0794e988383abc14 Mon Sep 17 00:00:00 2001 From: larsevj Date: Thu, 30 Nov 2023 13:04:27 +0100 Subject: [PATCH] Use StrEnum in python 3.11 --- webviz_ert/models/data_model.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/webviz_ert/models/data_model.py b/webviz_ert/models/data_model.py index ff8cb3d9..e50ee601 100644 --- a/webviz_ert/models/data_model.py +++ b/webviz_ert/models/data_model.py @@ -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"