A lightweight, object-oriented finite state machine implementation in Python with many extensions
Release 0.8.3 is a minor release and contains several bugfixes mostly related to HierarchicalStateMachine
:
is_<model_attribute>_<state_name>
instead of is_<state_name>
when model_attribute != "state"
to enable multiple versions of such convenience functions. A warning will be raised when is_<state_name>
is used. (thanks @artofhuman)to_<state_name>
) will be assigned as to_<model_attribute>_<state_name>
. to_<state_name>
will work as before but raise a warning until version 0.9.0.allow_substates
did not consider enum stateschildren
with initial
parameterTransitionGraphSupport
(thanks @badiku)State.enter/exit
debug message emitted when callbacks have been processed.before_state_change/before
and after/after_state_change
in AsyncMachine
(thanks @tzoiker and @vishes-shell)Graph.get_graph()
did not consider enum
states when show_roi=True
(thank @termim)Release 0.8.2 is a minor release and contains several bugfixes and improvements:
graphviz
package_check_event_result
failed when model was in parallel statedest=None
in Machine.add_transition
(not just falsy) for internal transitions (thanks @Pathfinder216)Model.trigger
now considers the machine's and current state's ignore_invalid_triggers
attribute and can be called with non-existing events (thanks @potens1)transitions.extensions.asyncio.AsyncTimeout
as a state decorator to avoid threads used in transitions.extensions.state.Timeout
(thanks @potens1)transitions
can now be tested online at mybinder.orgRelease 0.8.1 is a minor release of HSM improvements and bugfixes in the diagram and async extension
HierarchicalAsync(Graph)Machine
HierarchicalMachine
(thanks @thedrow)Enum
(thanks @kbinpgh)HierarchicalMachine
(thanks @xiaohuihui1024)xdist
for parallel testing with pytest
(thanks @thedrow)Release 0.8.0 is a major release and introduces asyncio support for Python 3.7+, parallel state support and some bugfixes
HierarchicalMachine
has been rewritten to support parallel states. Please have a look at the ReadMe.md to check what has changed.
transitions.extensions.nesting_legacy
for nowAsyncMachine
(see discussion #259); note that async HSMs are not yet supportedEnum
into strings in MarkupMachine
when necessaryMachine.add_ordered_transitions
to be called without the initial state (thanks @mkaranki and @facundofc)GraphMachine
now attempts to fall back to graphviz
when importing pygraphviz
failsRelease 0.7.2 is a minor release and contains bugfixes and and a new feature:
Release 0.7.1 is a minor release and contains several documentation improvements and a new feature:
enum
Python 2.7: enum34
) support (thanks @artofhuman and @justinttl)nosetests
with pytest
(thanks @artofhuman)add_ordered_transitions
documentation in Readme.md
examples/Frequently asked questions.ipynb
long_description
in setup.py
(thanks @artofhuman)Release 0.7.0 is a major release with fundamental changes to the diagram extension. It also introduces an intermediate MarkupMachine
which can be used to transfer and (re-)initialize machine configurations.
MarkupMachine
can be used to retrieve a Machine's dictionary representation
GraphMachine
uses this representation for Graphs now and does not rely on Machine
attributes any longerState.ignore_invalid_triggers
changed to None
. If it is not explicitly set, the Machine
's value is used instead.pygraphviz
and graphviz
for the creation of diagrams. Currently, GraphMachine
will check for pygraphviz
first and fall back to graphviz
. To use graphviz
directly pass use_pygraphiv=False
to the constructor of GraphMachine
GraphMachine
's attributes machine_attributes
and style_attributes
to adjust it to your needs.get_graph
was not assigned to models added during machine runtime