-
Notifications
You must be signed in to change notification settings - Fork 533
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
Static typing improvements, add Mermaid support and may_trigger for models #677
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aleneum
force-pushed
the
dev-experimental-model-creation
branch
from
June 12, 2024 16:23
c76b91f
to
05ec3ed
Compare
Scope of expect_override was too narrow and does not solve the typing issue adequately this reverts #676
…ils.generate_base_model` When `model_override` is set to True, Machine will assign only methods to a model that are already defined. This eases static type checking (#658) and enables tailored helper function assigment. Default value is False which prevents override of already defined model functions.
Adds state.final, on_exception, on_final and model_override
…ns, event, with_model_definitions, transition} Add helper functions to define transitions on a model class for better type checking (#658)
`model.may_trigger(event_name)` allows to call `model.may_event_name` by name, juas as `model.trigger(event_name)` does for `model.event_name`
mermaid graph backend can generate valid mermaid diagram strings that can be passed to e.g. GitHub/GitLab or some other web services. use_graphviz is deprecated now. Use graph_engine with `pygraphviz` (default), `graphviz` or `mermaid` this closes #611
…, with_model_definitions, transition}
aleneum
force-pushed
the
dev-experimental-model-creation
branch
from
June 18, 2024 13:17
33c04d4
to
fc82b15
Compare
aleneum
changed the title
Remove
Static typing improvements, add Mermaid support and may_trigger for models
Jun 18, 2024
expect_override
;introduce new __init__ attribute model_override
, generate_base_model
and trigger
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is meant to improve type-safe-ish work with transitions.
expect_override
was replaced withmodel_override
as a construction parameter. Withmodel_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