From 846af0586a415d1039d03ab95923a9423c248cfb Mon Sep 17 00:00:00 2001 From: Mirko Lenz Date: Tue, 7 Feb 2023 17:02:00 +0100 Subject: [PATCH] fix: all enums now inherit from str --- arguebuf/dump/_config.py | 4 ++-- arguebuf/model/scheme.py | 8 ++++---- arguebuf/schemas/graphviz.py | 2 +- arguebuf/schemas/microtexts.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arguebuf/dump/_config.py b/arguebuf/dump/_config.py index d8c10ea..58ff3a0 100644 --- a/arguebuf/dump/_config.py +++ b/arguebuf/dump/_config.py @@ -1,12 +1,12 @@ from __future__ import annotations from dataclasses import dataclass -from enum import Enum, auto +from enum import Enum __all__ = ("Format", "Config") -class Format(Enum): +class Format(str, Enum): ARGUEBUF = "arguebuf" AIF = "aif" diff --git a/arguebuf/model/scheme.py b/arguebuf/model/scheme.py index d075ac2..a3549b4 100644 --- a/arguebuf/model/scheme.py +++ b/arguebuf/model/scheme.py @@ -10,7 +10,7 @@ __all__ = ("Scheme", "Support", "Attack", "Preference", "Rephrase") -class Support(Enum): +class Support(str, Enum): """Enumeration of all available Argumentation Schemes (Walton et al.) .. autoclasssumm:: Support @@ -88,7 +88,7 @@ class Support(Enum): # DEFINITION = "Definition" -class Attack(Enum): +class Attack(str, Enum): """Enumeration of attacking schemes .. autoclasssumm:: Attack @@ -98,7 +98,7 @@ class Attack(Enum): DEFAULT = "Default" -class Preference(Enum): +class Preference(str, Enum): """Enumeration of preference schemes .. autoclasssumm:: Preference @@ -108,7 +108,7 @@ class Preference(Enum): DEFAULT = "Default" -class Rephrase(Enum): +class Rephrase(str, Enum): """Enumeration of rephrase schemes .. autoclasssumm:: Rephrase diff --git a/arguebuf/schemas/graphviz.py b/arguebuf/schemas/graphviz.py index 1dea0f7..6af3899 100644 --- a/arguebuf/schemas/graphviz.py +++ b/arguebuf/schemas/graphviz.py @@ -6,7 +6,7 @@ GraphvizGraph = t.Union[Digraph, t.Any] -class EdgeStyle(Enum): +class EdgeStyle(str, Enum): BEZIER = "curved" STRAIGHT = "line" STEP = "ortho" diff --git a/arguebuf/schemas/microtexts.py b/arguebuf/schemas/microtexts.py index 7302289..dc129de 100644 --- a/arguebuf/schemas/microtexts.py +++ b/arguebuf/schemas/microtexts.py @@ -1,7 +1,7 @@ from enum import Enum -class EdgeType(Enum): +class EdgeType(str, Enum): SEGMENTATION = "seg" SUPPORT_DEFAULT = "sup" SUPPORT_EXAMPLE = "exa"