Closed thedrow closed 4 years ago
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? https://github.com/pytransitions/transitions/blob/070b45047a7d9c253401a39086b0f1ccc5b8dfc4/transitions/extensions/nesting.py#L27-L28
Setting the initial to Bar.C
uncovered a bug in this PR that causes the test to fail because of the Graphvis extension.
I fixed it now. I'll generate a graph and see if it looks correct.
Looks right to me :)
Merged! Thanks again for your valuable contributions!
Setting the initial to Bar.C uncovered a bug in this PR that causes the test to fail because of the Graphvis extension.
this is comparable to #400 and should be fixed with 0a66a36. An additional test in set_node_style
should not be necessary anymore. I removed it.
Sidenote: Enums with identical values cannot be distinguished. That should be at least mentioned in the documentation.
Do we need to remove this check?
~Wait, what about this?~ Nevermind, I see your commits. But check my comments.
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?