Skip to content

Commit 71d88bc

Browse files
committed
chore: Docs improvements; removing mermaid from docs build
1 parent 05fe36d commit 71d88bc

5 files changed

Lines changed: 18 additions & 20 deletions

File tree

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"sphinx.ext.doctest",
4949
"sphinx.ext.napoleon",
5050
"sphinx.ext.viewcode",
51-
"sphinxcontrib.mermaid",
5251
"sphinx.ext.autosectionlabel",
5352
"sphinx_gallery.gen_gallery",
5453
"jupyterlite_sphinx",

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Sphinx<5.0.0
33
sphinx_rtd_theme==1.1.1
44
sphinx-markdown-builder==0.5.5
55
myst-parser==0.18.1
6-
sphinxcontrib-mermaid==0.7.1
76
jupyterlite-sphinx==0.7.2
87
sphinx-gallery==0.11.1
98
matplotlib==3.6.2

docs/transitions.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,8 @@ TransitionList([Transition(State('Draft', ...
6464

6565
Consider this traffic light machine as example:
6666

67-
```{mermaid}
68-
:align: center
67+
![TrafficLightMachine](images/traffic_light_machine.png)
6968

70-
stateDiagram-v2
71-
direction LR
72-
[*] --> green
73-
green --> yellow: cycle
74-
yellow --> red: cycle
75-
red --> green: cycle
76-
77-
```
7869

7970
There're tree transitions, one starting from green to yellow, another from
8071
yellow to red, and another from red back to green. All these transitions

statemachine/statemachine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def allowed_transitions(self):
150150

151151
@property
152152
def allowed_events(self):
153-
"get the callable proxy of the current allowed transitions"
153+
"get the callable proxy of the current allowed events"
154154
return [
155155
getattr(self, event)
156156
for event in self.current_state.transitions.unique_events

statemachine/transition.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,26 @@
77

88

99
class Transition(object):
10-
"""
11-
A transition holds reference to the source and target state.
10+
"""A transition holds reference to the source and target state.
1211
1312
Args:
14-
source (State): The origin :ref:`State` of the transition.
15-
target (State): The target :ref:`State` of the transition.
13+
source (State): The origin state of the transition.
14+
target (State): The target state of the transition.
1615
event (Optional[Union[str, List[str]]]): List of designators of events that trigger this
17-
transition.
18-
19-
Can be either a list of strings, or a space-separated string list of event
16+
transition. Can be either a list of strings, or a space-separated string list of event
2017
descriptors.
18+
validators (Optional[Union[str, Callable, List[Callable]]]): The validation callbacks to
19+
be invoked before the transition is executed.
20+
cond (Optional[Union[str, Callable, List[Callable]]]): The condition callbacks to be
21+
invoked before the transition is executed that should evaluate to `True`.
22+
unless (Optional[Union[str, Callable, List[Callable]]]): The condition callbacks to be
23+
invoked if the `cond` is False before the transition is executed.
24+
on (Optional[Union[str, Callable, List[Callable]]]): The callbacks to be invoked
25+
when the transition is executed.
26+
before (Optional[Union[str, Callable, List[Callable]]]): The callbacks to be invoked
27+
before the transition is executed.
28+
after (Optional[Union[str, Callable, List[Callable]]]): The callbacks to be invoked
29+
after the transition is executed.
2130
"""
2231

2332
def __init__(

0 commit comments

Comments
 (0)