- Bug #688:
Machine.remove_transitionsdid not work withStateandEnumeven though the signature implied this (thanks @hookokoko) - PR #696: Improve handling of
StrEnumwhich were previously confused as string (thanks @jbrocher) - Bug #697: An empty string as a destination made a transition internal but only
dest=Noneshould do this (thanks @rudy-lath-vizio) - Bug #704:
AsyncMachineprocessed allCancelledErrorsbut will from now on only do so if the error message is equal toasyncio.CANCELLED_MSG; this should make bypassing catch clauses easier; requires Python 3.11+ (thanks @Salier13) - Feature #710:
experimental.utils.generate_base_modelcan now be called with an instance of MarkupMachine directly (thanks @patrickwolf) - Bug #715:
HierarchicalMachine._final_checkwrongly determined a parallel state final when the last child was final (thanks @DenizKucukozturk) - Bug #716:
HierarchicalMachinecaused anAssertionErrorwhenmodel_overridewasTrueandNestedSeperatordiffered from_(thanks @pritam-dey3)
- Bug #682:
AsyncTimeoutdid not stop execution (thanks @matt3o) - Bug #683: Typing wrongly suggested that
Transitioninstances can be passed toMachine.__init__and/orMachine.add_transition(s)(thanks @antonio-antuan) - Bug #692: When adding an already constructed
NestedState, FunctionWrapper was not properly initialized (thanks @drpjm) - Bug #701:
Machine.dispatchshould not short-circuit when a model returns False (thanks @Joshuaalbert) - Typing should be more precise now
- Made
transitions.core.(Async)TransitionConfigDictaTypedDictwhich can be used to spot parameter errors during static analysis Machine.add_transitionsandMachine.__init__expect aSequenceof configurations for transitions now- Added 'async' callbacks to types in
asyncioextension
- Made
Release 0.9.2 is a minor release and contains a new mermaid diagram backend, a new model decoration mode for easier development with types and some more features and bugfixes.
- Bug #610: Decorate models appropriately when
HierarchicalMachineis passed toadd_state(thanks @e0lithic) - Bug #647: Let
may_<trigger>check all parallel states in processing order (thanks @spearsear) - Bug:
HSM.is_stateworks with parallel states now - Experimental features:
- Add
model_overrideto Machine constructor to determine the mode of operation. Withmodel_override=Fale(default),transitionswill not override already defined methods on a model just as it did before. For workflows relying on typing,model_override=Truewill override methods already defined on the model and only those (!). This allows to control which convenience methods shall be assigned to the model and keeps the statically 'assumed' model in sync with its runtime counterpart. Since defining each and every method manually is rather tiresome,transitions.experimental.utils.generate_base_modelfeatures a way to convert a machine configuration into aBaseClasswith all convenience functions and callbacks. - Add
transitions.experimental.utils.{add_transitions, event, with_model_definitions, transition}to define trigger methods in a class model for more convenient type checking.add_transitionscan be used as a function decorator and is stackable.eventreturns a placeholder object for attribute assigment.add_transitionsandeventhave the same signature and support transition definition like machine constructors. The functiontransitioncan used for better typing and returns a dictionary that can be passed to the utility functions but also to a machine constructor.add_transitionsandeventrequire a machine decorated withwith_model_definitions. Decorating a machinewith_model_definitionsimpliesmodel_override=True.
- Add
- Feature: Add
may_triggerto models to check whether transitions can be conducted by trigger name. - Feature: Add Mermaid diagram backend that returns a mermaid diagram as a string.
use_pygraphvizis deprecated in favour forgraph_enginewhich may bepygraphviz(default),graphvizormermaid.
Release 0.9.1 is a minor release and contains several bugfixes and some (typing) improvements. This release also introduces on_final callbacks on machines (as well as NestedState) and final flags for states.
- Bug #594: Fix may_ always returning false for internal transitions (thanks @a-schade)
- PR #592: Pass investigated transition to
EventDatacontext in 'may' check (thanks @msclock) - PR #634: Improve the handling of diagrams when working with parallel states, especially when using the show_roi option (thanks @seanxlliu)
- Bug #619/#639:
Exceptionis not broad enough and does not catchasyncio.CancelledErrororKeyboardInterrupt; useBaseExceptioninstead (thanks @e0lithic and @ofacklam) - '_anchor' suffix has been removed for (py)graphviz cluster node anchors
- local testing switched from tox to nox
- PR #633: Remove surrounding whitespace from docstrings (thanks @artofhuman)
- PR #665: Add
on_finaltoMachineandNestedStateconstructor andfinaltoState. Callbacks passed toon_finalwill be executed when a State withfinal=Trueis entered or all children of a parallel state are final. - Bug #626: Process exceptions with
Machine.on_exceptionin may_ as well (thanks @match1) - PR #666: Improved handling of removing transitions for
GraphMachineandHiearachicalMachine(thanks @drpjm) - PR #667: Better handling of unset styling in
GraphMachine - Typing:
- Added
--strictmypy flag fortransitionstype checks (notteststhough) - Made state, event and machine property mandatory in (Nested)EventData
- Transition.dest may be None
- Introduced (Async)CallbackFunc to declutter callback-related signatures
- Add stub file for extension package for explicite reexport (thanks @DrewDevereux)
- Added
Release 0.9.0 is a major release and contains improvements to ease development, adds some new features and removes the legacy hierarchical machine:
- removed legacy implementation of
HierarchicalMachinefrom the package - Bug #551: Fix active state styling in
GraphMachine(thanks @betaboon) - Bug #554: Fix issues related to scopes and queueing in
HierachicalMachine(thanks @jankrejci) - Bug #568: Reflexive transitions (dest: '=') had not been resolved correctly when source was a wildcard (thanks @jnu)
- Bug #568: HSM did not detect reflexive transitions if src was a parent state (thanks @lostcontrol)
- Bug #569: Fix implicit fallback to
graphvizwhenpygraphvizwas not installed (thanks @FridjofAmundsen) - Bug #580: Fix
on_timeoutcallback resolution when timeout had been initialized withtimeout=0(thanks @Rysbai) - Bug #582: Last label in
GraphSupportwas not correctly aligned whenshow_attributes=True(thanks @spagh-eddie) - Feature: Add pyi stub files for better type hinting. Since many functions and constructors allow rather arbitrary arguments time will tell whether typing should be strict (and cause more mypy issues) or more relaxed (and thus less precise).
- Feature: Reviewed and improved method documentation
- Feature #549: Add
maytransition check to transitions (thanks @artofhuman) - Feature #552: Refactored error handling to be able to handle
MachineErrorinon_exceptioncallbacks (thanks @kpihus) - Feature: Add
mypyto test workflow - PR #461: Add
Retrystate to supported state stereotypes (thanks @rgov) - Internal:
Machine._identify_callbackhas been converted to instance method from class method - Internal:
LockedMachine._get_qualified_state_namehas been converted to instance method from static method - Internal: Removed
_superworkaround related to dill (see #236)
Release 0.8.11 is the last 0.8 release and contains fixes for Python 3.10 compatibility issues
- Bug #559: Rewrote an async test and replaced
setDaemonwithdaemonproperty assignment for thread handling (thanks @debalance)
Release 0.8.10 is a minor release and contains two bug fixes for the HSM extension and changes how the 'self' literal string is handled.
- Feature #545: The literal 'self' (default model parameter of
Machine) has been replaced by the class variableMachine.self_literal = 'self'.Machinenow performs an identity check (instead of a value check) withmod is self.self_literalto determine whether it should act as a model. While 'self' should still work when passed to themodelparameter, we encourage usingMachine.self_literalfrom now on. This was done to enable easier override ofMachine.__eq__in subclasses (thanks @VKSolovev). - Bug #547: Introduce
HierarchicalMachine.prefix_pathto resolve global state names since the HSM stack is not reliable whenqueued=True(thanks @jankrejci). - Bug #548:
HSMsource states were exited even though they are parents of the destination state (thanks @wes-public-apps).
Release 0.8.9 is a minor release and contains a bugfix for HSM, a feature for GraphSupport and changes internal cache handling:
- Bugfix #544:
NestedEventnow wraps the machine's scope into partials passed toHierarchicalMachine._process. This prevents queued transitions from losing their scope. - Feature #533:
(A)Graph.drawfunction (object returned byGraphMachine.get_graph()) can be passed a file/stream object as first parameter orNone. The later will result indrawreturning a binary string. (thanks @Blindfreddy). - Feature #532: Use id(model) instead of model for machine-bound caches in
LockedMachine,AsyncMachineandGraphMachine. This might influence pickling (thanks @thedrow).
Release 0.8.8 is a minor release and contains a bugfix and several new or improved features:
- Bugfix #526:
AsyncMachinedoes not remove models whenremove_modelsis called (thanks @Plazas87) - Feature #517: Introduce
try/exceptfor finalize callbacks inMachineandHierachicalMachine. Thus, errors occurring in finalize callbacks will be suppressed and only the original error will be raised. - Feature #520: Show references in graphs and markup. Introduce
MarkupMachine.format_referencesto tweak reference formatting (thanks @StephenCarboni) - Feature #485: Introduce
Machine.on_exceptionto handle raised exceptions in callbacks (thanks @thedrow) - Feature #527:
Machine.get_triggersnow supportsStateandEnumas arguments (thanks @luup2k) - Feature #506:
NestedStateandHierachicalMachine.add_statesnow accept (lists of) states and enums asinitialparameter
Release 0.8.7 is a minor release and contains a bugfix, a feature and adjustments to internal processes:
- State configuration dictionaries passed to
HierarchicalMachinecan also usestatesas a keyword to define substates. Ifchildrenandstatesare present, onlychildrenwill be considered. - Feature #500:
HierarchicalMachinewith custom separator now addsis_statepartials for nested states (e.g.is_C.s3.a()) to models (thanks @alterscape) - Bugfix #512: Use
model_attributeconsistently inAsyncMachine(thanks @thedrow) - Testing now treats most warnings as errors (thanks @thedrow)
- As a consequence,
pygraphviz.Agraphindiagrams_pygraphvizare now copied bytransitionssinceAGraph.copyas of version1.6does not close temporary files appropriately HierarchicalMachinenow checks whetherstate_cls,event_clsandtransition_clshave been subclassed from nested base classes (e.g.NestedState) to prevent hard to debug inheritance errors
Release 0.8.6 is a minor release and contains bugfixes and new features:
HierarchicalMachine.add_stateswill raise aValueErrorwhen anEnumname contains the currently usedNestedState.separator.- Bugfix #486: Reset
NestedState._scopewhen enter/exit callbacks raise an exception (thanks @m986883511) - Bugfix #488: Let
HierarchicalMachine._get_triggerwhich is bound tomodel.triggerraise aMachineErrorfor invalid events andAttributeErrorfor unknown events (thanks @hsharrison) - Introduced
HierarchicalMachine.has_triggerto determine whether an event is valid for an HSM - Feature #490:
AsyncMachinefeatures an event queue dictionary for individual models whenqueued='model'(thanks @jekel) - Feature #490:
Machine.remove_modelwill now also remove model events from the event queue whenqueued=True - Feature #491:
Machine.get_transitionsand its HSM counterpart now acceptEnumandStateforsourceanddest(thanks @thedrow)
Release 0.8.5 is a minor release and contains bugfixes:
AsyncMachine.switch_model_contextis expected to beasyncnow for easier integration of async code during model switch.- Bugfix #478: Initializing a machine with
GraphSupportthrew an exception when initial was set to a nested or parallel state (thanks @nickvazztau)
Release 0.8.4 is a minor release and contains bugfixes as well as new features:
- Bugfix #477: Model callbacks were not added to a LockedHierarchicalMachine when the machine itself served as a model (thanks @oliver-goetz)
- Bugfix #475: Clear collection of tasks to prevent memory leak when initializing many models (thanks @h-nakai)
- Feature #474: Added static
AsyncMachine.protected_taskslist which can be used to preventtransitionsto cancel certain tasks. - Feature: Constructor of
HierarchicalMachinenow accepts substates ('A_1_c') and parallel states (['A', 'B']) asinitialparameter
Release 0.8.3 is a minor release and contains several bugfixes mostly related to HierarchicalStateMachine:
- Feature #473: Assign
is_<model_attribute>_<state_name>instead ofis_<state_name>whenmodel_attribute != "state"to enable multiple versions of such convenience functions. A warning will be raised whenis_<state_name>is used. (thanks @artofhuman) - Similarly, auto transitions (
to_<state_name>) will be assigned asto_<model_attribute>_<state_name>.to_<state_name>will work as before but raise a warning until version 0.9.0. - Bugfix:
allow_substatesdid not consider enum states - Feature: Nested enums can now be passed in a dict as
childrenwithinitialparameter - Bugfix #449: get_triggers/get_transitions did not return nested triggers correctly (thanks @alexandretanem)
- Feature #452: Improve handling of label attributes in custom diagram states and
TransitionGraphSupport(thanks @badiku) - Bugfix #456: Prevent parents from overriding (falsy) results of their children's events (thanks @alexandretanem)
- Bugfix #458: Entering the same state caused key errors when transition was defined on a parent (thanks @matlom)
- Bugfix #459: Do not remove current timeout runner in AsyncTimeout to prevent accidental overrides (thanks @rgov)
- Rewording of
State.enter/exitdebug message emitted when callbacks have been processed. - Bugfix #370: Fix order of
before_state_change/beforeandafter/after_state_changeinAsyncMachine(thanks @tzoiker and @vishes-shell) - Bugfix #470:
Graph.get_graph()did not considerenumstates whenshow_roi=True(thanks @termim)
Release 0.8.2 is a minor release and contains several bugfixes and improvements:
- Bugfix #438: Improved testing without any optional
graphvizpackage - Bugfix:
_check_event_resultfailed when model was in parallel state - Bugfix #440: Only allow explicit
dest=NoneinMachine.add_transition(not just falsy) for internal transitions (thanks @Pathfinder216) - Bugfix #419: Fix state creation of nested enums (thanks @thedrow)
- Bugfix #428: HierarchicalGraphMachine did not find/apply styling for parallel states (thanks @xiaohuihui1024)
- Bugfix:
Model.triggernow considers the machine's and current state'signore_invalid_triggersattribute and can be called with non-existing events (thanks @potens1) - Bugfix: Child states may not have been exited when the executed transition had been defined on a parent (thanks @thedrow)
- Feature #429: Introduced
transitions.extensions.asyncio.AsyncTimeoutas a state decorator to avoid threads used intransitions.extensions.state.Timeout(thanks @potens1) - Feature #444:
transitionscan now be tested online at mybinder.org - PR #418: Use sets instead of lists to cache already covered transitions in nested state machines (thanks @thedrow)
- PR #422: Improve handling of unresolved attributes for easier inheritance (thanks @thedrow)
- PR #445: Refactored AsyncMachine to enable trio/anyio override
Release 0.8.1 is a minor release of HSM improvements and bugfixes in the diagram and async extension:
- Feature: Introduced experimental
HierarchicalAsync(Graph)Machine - Feature #405: Support for nested Enums in
HierarchicalMachine(thanks @thedrow) - Bugfix #400: Fix style initialization when initial state is an
Enum(thanks @kbinpgh) - Bugfix #403: AsyncMachine.dispatch now returns a boolean as expected (thanks @thedrow)
- Bugfix #413: Improve diagram output for
HierarchicalMachine(thanks @xiaohuihui1024) - Increased coverage (thanks @thedrow)
- Introduced
xdistfor parallel testing withpytest(thanks @thedrow)
Release 0.8.0 is a major release and introduces asyncio support for Python 3.7+, parallel state support and some bugfixes:
- Feature:
HierarchicalMachinehas been rewritten to support parallel states. Please have a look at the ReadMe.md to check what has changed.- The previous version can be found in
transitions.extensions.nesting_legacyfor now
- The previous version can be found in
- Feature: Introduced
AsyncMachine(see discussion #259); note that async HSMs are not yet supported - Feature #390: String callbacks can now point to properties and attributes (thanks @jsenecal)
- Bugfix: Auto transitions are added multiple times when add_states is called more than once
- Bugfix: Convert state._name from
Enuminto strings inMarkupMachinewhen necessary - Bugfix #392: Allow
Machine.add_ordered_transitionsto be called without the initial state (thanks @mkaranki and @facundofc) GraphMachinenow attempts to fall back tographvizwhen importingpygraphvizfails- Not implemented/tested so far (contributions are welcome!):
- Proper Graphviz support of parallel states
- AsyncHierachicalMachine
Release 0.7.2 is a minor release and contains bugfixes and a new feature:
- Bugfix #386: Fix transitions for enums with str behavior (thanks @artofhuman)
- Bugfix #378: Don't mask away KeyError when executing a transition (thanks @facundofc)
- Feature #387: Add support for dynamic model state attribute (thanks @v1k45)
Release 0.7.1 is a minor release and contains several documentation improvements and a new feature:
- Feature #334: Added Enum (Python 3.4+:
enumPython 2.7:enum34) support (thanks @artofhuman and @justinttl) - Replaced test framework
nosetestswithpytest(thanks @artofhuman) - Extended
add_ordered_transitionsdocumentation inReadme.md - Collected code snippets from earlier discussions in
examples/Frequently asked questions.ipynb - Improved stripping of
long_descriptioninsetup.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.
- Feature #263:
MarkupMachinecan be used to retrieve a Machine's dictionary representationGraphMachineuses this representation for Graphs now and does not rely onMachineattributes any longer
- Feature: The default value of
State.ignore_invalid_triggerschanged toNone. If it is not explicitly set, theMachine's value is used instead. - Feature #325: transitions now supports
pygraphvizandgraphvizfor the creation of diagrams. Currently,GraphMachinewill check forpygraphvizfirst and fall back tographviz. To usegraphvizdirectly passuse_pygraphiv=Falseto the constructor ofGraphMachine - Diagram style has been overhauled. Have a look at
GraphMachine's attributesmachine_attributesandstyle_attributesto adjust it to your needs. - Feature #305: Timeouts and other features are now marked in the graphs
- Bugfix #343:
get_graphwas not assigned to models added during machine runtime
Release 0.6.9 is a minor release and contains two bugfixes:
- Bugfix #314: Do not override already defined model functions with convenience functions (thanks @Arkanayan)
- Bugfix #316:
state.Errordid not call parent'sentermethod (thanks @potens1)
Release 0.6.8 is a minor release and contains a critical bugfix:
- Bugfix #301: Reading
Readme.mdinsetup.pycauses aUnicodeDecodeErrorin non-UTF8-locale environments (thanks @jodal)
Release 0.6.7 is identical to 0.6.6. A release had been necessary due to #294 related to PyPI.
Release 0.6.6 is a minor release and contains several bugfixes and new features:
- Bugfix:
HierarchicalMachinenow considers the initial state ofNestedStateinstances/names passed toinitial. - Bugfix:
HierarchicalMachineused to ignore children whenNestedStateswere added to the machine. - Bugfix #300: Fixed missing brackets in
TimeoutState(thanks @Synss) - Feature #289: Introduced
Machine.resolve_callable(func, event_data)to enable customization of callback definitions (thanks @ollamh and @paulbovbel) - Feature #299: Added support for internal transitions with
dest=None(thanks @maueki) - Feature: Added
Machine.dispatchto trigger events on all models assigned toMachine
Release 0.6.5 is a minor release and contains a new feature and a bugfix:
- Feature #287: Embedding
HierarchicalMachinewill now reuse the machine'sinitialstate. Passinginitial: Falseoverrides this (thanks @mrjogo). - Bugfix #292: Models using
GraphMashinewere not picklable in the past due tographproperty. Graphs for each model are now stored inGraphMachine.model_graphs(thanks @ansumanm).
Release 0.6.4 is a minor release and contains a new feature and two bug fixes related to HierachicalMachine:
- Bugfix #274:
initialhas not been passed to super inHierachicalMachine.add_model(thanks to @illes). - Feature #275:
HierarchicalMachine.add_statesnow supports keywordparentto be aNestedStateor a string. - Bugfix #278:
NestedStatehas not been exited correctly during reflexive triggering (thanks to @hrsmanian).
Release 0.6.3 is a minor release and contains a new feature and two bug fixes:
- Bugfix #268:
Machine.add_ordered_transitionschanged states' order ifinitialis not the first or last state (thanks to @janekbaraniewski). - Bugfix #265: Renamed
HierarchicalMachine.tototo_stateto prevent warnings when HSM is used as a model. - Feature #266: Introduce
Machine.get_transitionsto get a list of transitions for alteration (thanks to @Synss).
Release 0.6.2 is a minor release and contains new features and bug fixes but also several internal changes:
- Documentation: Add docstring to every public method
- Bugfix #257: Readme example variable had been capitalized (thanks to @fedesismo)
- Add
appveyor.ymlfor Windows testing; However, Windows testing is disabled due to #258 - Bugfix #262: Timeout threads prevented program from execution when main thread ended (thanks to @tkuester)
prep_ordered_argis now protected incore- Convert
loggerinstances to_LOGGERto comply with protected module constant naming standards traverseis now protected inHierarchicalMachine- Remove abstract class
Diagramsince it did not add functionality todiagrams - Specify several overrides of
add_stateoradd_transitionto keep the base class parameters instead of*argsand**kwargs - Change several
if len(x) > 0:checks toif x:as suggested by the static code analysis to make use of falsy empty lists/strings.
Release 0.6.1 is a minor release and contains new features as well as bug fixes:
- Feature #245: Callback definitions ('before', 'on_enter', ...) have been moved to classes
TransitionandState - Bugfix #253:
Machine.remove_transitionsconverteddefaultdictinto dict (thanks @Synss) - Bugfix #248:
HierarchicalStateMachine's copy procedure used to cause issues with function callbacks and object references (thanks @Grey-Bit) - Renamed
Machine.idtoMachine.nameto be consistent with the constructor parametername - Add
Machine.add_transitionsfor adding multiple transitions at once (thanks @Synss)
Release 0.6.0 is a major release and introduces new state features and bug fixes:
add_state_featuresconvenience decorator supports creation of custom statesTagsmakes states taggableErrorchecks for error states (not accepted states that cannot be left); subclass ofTagsVolatileenables scoped/temporary state objects to handle context parameters- Removed
add_selffromMachineconstructor pygraphvizis now optional; usepip install transitions[diagrams]to install it- Narrowed warnings filter to prevent output cluttering by other 3rd party modules (thanks to @ksandeep)
- Reword HSM exception when wrong state object had been passedn (thanks to @Blindfreddy)
- Improved handling of partials during graph generation (thanks to @Synss)
- Introduced check to allow explicit passing of callback functions which match the
on_enter_<state>scheme (thanks to @termim) - Bug #243: on_enter/exit callbacks defined in dictionaries had not been assigned correctly in HSMs (thanks to @Blindfreddy)
- Introduced workaround for Python 3 versions older than 3.4 to support dill version 0.2.7 and higher (thanks to @mmckerns)
- Improved manifest (#242) to comply with distribution standards (thanks to @jodal)
Release 0.5.3 is a minor release and contains several bug fixes:
- Bug #214:
LockedMachineas a model prevented correct addition ofon_enter/exit_<state>(thanks to @kr2) - Bug #217: Filtering rules for auto transitions in graphs falsely filtered certain transitions (thanks to @KarolOlko)
- Bug #218: Uninitialized
EventData.transitioncausedAttributeErrorinEventData.__repr__(thanks to @kunalbhagawati) - Bug #215: State instances passed to
initialparameter ofMachineconstructor had not been processed properly (thanks @mathiasimmer)
Release 0.5.2 is a minor release and contains a bug fix:
- Bug #213: prevent
LICENSEto be installed to root of installation path
Release 0.5.1 is a minor release and contains new features and bug fixes:
- Added reflexive transitions (thanks to @janLo)
- Wildcards for reflexive (
wildcard_same) and all (wildcard_all) destinations areMachineclass variables now which can be altered if necessary. - Add LICENSE to packaged distribution (thanks to @bachp)
- Bug #211:
prepareandfinalizedhad not been called for HierarchicalMachines (thanks to @booware)
Release 0.5.0 is a major release:
- CHANGED API:
MachineErroris now limited to internal error and has been replaced byAttributeErrorandValueErrorwhere applicable (thanks to @ankostis) - CHANGED API: Phasing out
add_self;model=Nonewill add NO model starting from next major release; usemodel='self'instead. - Introduced deprecation warnings for upcoming changes concerning
Machinekeywordsmodelandadd_self - Introduced
Machine.remove_transition(thanks to @PaleNeutron) - Introduced
Machine._create_statefor easier subclassing of states LockedMachinenow supports custom context managers for each model (thanks to @paulbovbel)Machine.before/after_state_changecan now be altered dynamically (thanks to @peendebak)Machine.add_ordered_transitionsnow supportsprepare,conditons,unless,beforeandafter(thanks to @aforren1)- New
prepare_eventandfinalize_eventkeywords to handle transitions globally (thanks to @ankostis) - New
show_auto_transitionskeyword forGraphMachine.__init__(defaultFalse); if enabled, show auto transitions in graph - New
show_roikeyword forGraphMachine._get_graph(defaultFalse); ifTrue, show only reachable states in retrieved graph - Test suite now skips contextual tests (e.g. pygraphviz) if dependencies cannot be found (thanks to @ankostis)
- Improved string representation of several classes (thanks to @ankostis)
- Improved
LockedMachineperformance by removing recursive locking - Improved graph layout for nested graphs
transitions.extensions.nesting.AGraphhas been split up intoGraphandNestedGraphfor easier maintenance- Fixed bug related to pickling
RLockin nesting - Fixed order of callback execution (thanks to @ankostis)
- Fixed representation of condition names in graphs (thanks to @cemoody)
Release 0.4.3 is a minor release and contains bug fixes and several new features:
- Support dynamic model addition via
Machine.add_model(thanks to @paulbovbel) - Allow user to explicitly pass a lock instance or context manager to LockedMachine (thanks to @paulbovbel)
- Fixed issue related to parsing of HSMs (thanks to @steval and @user2154065 from SO)
- When
Stateis passed toMachine.add_transition, it will check if the state (and not just the name) is known to the machine
Release 0.4.2 contains several new features and bugfixes:
- Machines can work with multiple models now (thanks to @gemerden)
- New
initialkeyword for nested states to automatically enter a child - New
Machine.triggermethod to trigger events by name (thanks to @IwanLD) - Bug fixes related to remapping in nested (thanks to @imbaczek)
- Log messages in
Transition.executeandMachine.__init__have been reassigned to DEBUG log level (thanks to @ankostis) - New
Machine.get_triggersmethod to return all valid transitions from (a) certain state(s) (thanks to @limdauto and @guilhermecgs)
Release 0.4.1 is a minor release containing bug fixes, minor API changes, and community feedback:
-
asyncis renamed toqueuedsince it describes the mechanism better -
HierarchicalStateMachine.is_state now provides
allow_substatesas an optional argument(thanks to @jonathanunderwood) -
Machine can now be used in scenarios where multiple inheritance is required (thanks to @jonathanunderwood)
-
Adds support for tox (thanks to @medecau and @aisbaa)
-
Bug fixes:
- Problems with conditions shown multiple times in graphs
- Bug which omitted transitions with same source and destination in diagrams (thanks to @aisbaa)
- Conditions passed incorrectly when HSMs are used as a nested state
- Class nesting issue that prevented pickling with dill
- Two bugs in HierarchicalStateMachine (thanks to @ajax2leet)
- Avoided recursion error when naming a transition 'process' (thanks to @dceresuela)
-
Minor PEP8 fixes (thanks to @medecau)
Release 0.4 is a major release that includes several new features:
- New
asyncMachine keyword allows queueing of transitions (thanks to @khigia) - New
nameMachine keyword customizes transitions logger output for easier debugging of multiple running instances - New
prepareTransition keyword for callbacks before any 'conditions' are checked (thanks to @TheMysteriousX) - New
show_conditionsGraphSupport keyword adds condition checks to dot graph edges (thanks to @khigia) - Nesting now supports custom (unicode) substate separators
- Nesting no longer requires a leaf state (e.g. to_C() does not enter C_1 automatically)
- Factory for convenient extension mixins
- Numerous minor improvements and bug fixes
Mostly a bug fix release. Changes include:
- Fixes graphing bug introduced in 0.3.0 (thanks to @wtgee)
- Fixes bug in dynamic addition of before/after callbacks (though this is a currently undocumented feature)
- Adds coveralls support and badge
- Adds a few tests to achieve near-100% coverage
Release 0.3 includes a number of new features (nesting, multithreading, and graphing) as well as bug fixes and minor improvements:
- Support for nested states (thanks to @aleneum)
- Basic multithreading support for function access (thanks to @aleneum)
- Basic graphing support via graphviz (thanks to @svdgraaf)
- Stylistic edits, minor fixes, and improvements to README
- Expanded and refactored tests
- Minor bug fixes
- Enabled pickling in Python 3.4 (and in < 3.4 with the dill module)
- Added reference to generating Transition in EventData objects
- Fixed minor bugs
- README improvements, added TOC, and typo fixes
- Condition checks now receive optional data
- Removed invasive basicConfig() call introduced with logging in 0.2.6
- Fixed import bug that prevented dependency installation at setup
- Added rudimentary logging for key transition and state change events
- Added generic before/after callbacks that apply to all state changes
- Ensured string type compatibility across Python 2 and 3
- Added ability to suppress invalid trigger calls
- Shorthand definition of transitions via lists
- Automatic detection of predefined state callbacks
- Fixed bug in automatic transition creation
- Added Changelog
- Added travis-ci support
- Cleaned up and PEP8fied code
- Added 'unless' argument to transitions that mirrors 'conditions'
- Python 2/3 compatibility
- Added automatic to_{state}() methods
- Added ability to easily add ordered transitions