pytransitions / transitions

A lightweight, object-oriented finite state machine implementation in Python with many extensions
MIT License
5.67k stars 529 forks source link

Static typing improvements, add Mermaid support and may_trigger for models #677

Closed aleneum closed 3 months ago

aleneum commented 3 months ago

This is meant to improve type-safe-ish work with transitions. expect_override was replaced with model_override as a construction parameter. With model_override=True it is expected that the model defines all intended decorated methods. Thus, transitions will only override methods that are already available. This PR also improves stub files by explicitly noting on_final, on_exception, allow_override.

Related Issues:

This will undo #676

coveralls commented 3 months ago

Coverage Status

coverage: 98.524% (-0.004%) from 98.528% when pulling 05ec3ed9e53d3a954dea626321492c4cf9bb3079 on dev-experimental-model-creation into 4a611dd8a0af853e22d3cf9b57ead622f84124b4 on master.

coveralls commented 3 months ago

Coverage Status

coverage: 98.281% (-0.2%) from 98.528% when pulling dfef212de7f214606920c4d3b85040e971675eaa on dev-experimental-model-creation into 4a611dd8a0af853e22d3cf9b57ead622f84124b4 on master.

coveralls commented 3 months ago

Coverage Status

coverage: 98.315% (-0.2%) from 98.528% when pulling 8f9aff5e506d0c16c4291c10c5cc6474bc5739c4 on dev-experimental-model-creation into 4a611dd8a0af853e22d3cf9b57ead622f84124b4 on master.

coveralls commented 3 months ago

Coverage Status

coverage: 98.272% (-0.3%) from 98.528% when pulling d7d05ab6e1b1eaf4a27fbae0855107d336486c1a on dev-experimental-model-creation into 4a611dd8a0af853e22d3cf9b57ead622f84124b4 on master.

coveralls commented 3 months ago

Coverage Status

coverage: 98.379% (-0.1%) from 98.528% when pulling 2fee317521f5dd237a40c5face050209cb8ede89 on dev-experimental-model-creation into 4a611dd8a0af853e22d3cf9b57ead622f84124b4 on master.

coveralls commented 3 months ago

Coverage Status

coverage: 98.379% (-0.1%) from 98.528% when pulling 33c04d41f25c9f37c04e207e42c8a50c82ad9633 on dev-experimental-model-creation into 4a611dd8a0af853e22d3cf9b57ead622f84124b4 on master.

coveralls commented 3 months ago

Coverage Status

coverage: 98.379% (-0.1%) from 98.528% when pulling fc82b1535014c0e1c4c70625d70abd63456d9dfb on dev-experimental-model-creation into 4a611dd8a0af853e22d3cf9b57ead622f84124b4 on master.