Skip to content

Commit

Permalink
Merge pull request #139 from scipp/cleanup_enum
Browse files Browse the repository at this point in the history
Make enum widgets show value and parameter name clearly
  • Loading branch information
MridulS authored Dec 4, 2024
2 parents 5892e9d + 0785cd6 commit 9cab4bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ess/reduce/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ class ParamWithOptions(Parameter[T]):

@classmethod
def from_enum(cls: type[C], t: type[T], default: T) -> C:
return cls(name=str(t), description=t.__doc__, options=t, default=default)
return cls(
name=t.__name__,
description=t.__doc__,
options=t.__members__,
default=default,
)


@dataclass
Expand Down

0 comments on commit 9cab4bb

Please sign in to comment.