Skip to content

Commit

Permalink
Add __str__ and __format__ methods for expected behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ppinchuk committed Nov 4, 2023
1 parent cc81ad4 commit 6ec7206
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sup3r/utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ class ModuleName(str, Enum):
VISUAL_QA = 'visual-qa'
REGRID = 'regrid'

def __str__(self):
return self.value

def __format__(self, format_spec):
return str.__format__(self.value, format_spec)

@classmethod
def all_names(cls):
"""All module names.
Expand Down

0 comments on commit 6ec7206

Please sign in to comment.