New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested enums now translate to nested states #405
Nested enums now translate to nested states #405
Conversation
That looks good to me. Some minor tweeks need to be done though (for instance here). Did you check whether the resulting Graphviz graphs look okay? Is it possible to determine the actual state and can you use auto transitions?: from enum import Enum, auto
class Foo(Enum):
A = auto() # 1
B = auto() # 2
class Bar(Enum):
FOO = Foo
C = auto() # 1
m = HierarchicalMachine(states=Bar, initial=Bar.C)
m.to_FOO_A() # does this work?
assert m.is_C() is False # a check by state.value would return True though |
Do we need to remove this check? transitions/transitions/extensions/nesting.py Lines 27 to 28 in 070b450
|
Setting the initial to |
Merged! Thanks again for your valuable contributions!
this is comparable to #400 and should be fixed with 0a66a36. An additional test in Sidenote: Enums with identical values cannot be distinguished. That should be at least mentioned in the documentation. |
|
Fixes #404.
This needs documentation but I don't know which version this feature will released on.
I'm assuming 0.9.0. Am I correct?