Skip to content

Commit

Permalink
xtriggers: docstring formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-sanders committed Apr 24, 2024
1 parent 44f184f commit adea8f8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
6 changes: 3 additions & 3 deletions cylc/flow/xtriggers/echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ def echo(*args, **kwargs) -> Tuple:
*args: Print to stdout.
**kwargs: Print to stdout, and return as output.
Returns:
(True/False, kwargs)
Examples:
>>> echo('Breakfast Time', succeed=True, egg='poached')
echo: ARGS: ('Breakfast Time',)
echo: KWARGS: {'succeed': True, 'egg': 'poached'}
(True, {'succeed': True, 'egg': 'poached'})
Returns
(True/False, kwargs)
"""
print("echo: ARGS:", args)
print("echo: KWARGS:", kwargs)
Expand Down
4 changes: 4 additions & 0 deletions cylc/flow/xtriggers/wall_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def wall_clock(offset: str = 'PT0S', sequential: bool = True):
ISO 8601 interval to wait after the cycle point is reached in real
time before triggering. May be negative, in which case it will
trigger before the real time reaches the cycle point.
sequential:
Wall-clock xtriggers are run sequentially by default.
See :ref:`Sequential Xtriggers` for more details.
"""
# NOTE: This is just a placeholder for the actual implementation.
# This is only used for validating the signature and for autodocs.
Expand Down
1 change: 1 addition & 0 deletions cylc/flow/xtriggers/workflow_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def workflow_state(
The task status required for this xtrigger to be satisfied.
message:
The custom task output required for this xtrigger to be satisfied.
.. note::
This cannot be specified in conjunction with ``status``.
Expand Down
26 changes: 13 additions & 13 deletions cylc/flow/xtriggers/xrandom.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ def xrandom(
Used to allow users to specialize the trigger with extra
parameters.
Returns:
tuple: (satisfied, results)
satisfied:
True if ``satisfied`` else ``False``.
results:
A dictionary containing the following keys:
``COLOR``
A random colour (e.g. red, orange, ...).
``SIZE``
A random size (e.g. small, medium, ...).
Examples:
If the percent is zero, it returns that the trigger condition was
not satisfied, and an empty dictionary.
Expand Down Expand Up @@ -74,19 +87,6 @@ def xrandom(
>>> xrandom(99.99, 0)
(True, {'COLOR': 'orange', 'SIZE': 'small'})
Returns:
tuple: (satisfied, results)
satisfied:
True if ``satisfied`` else ``False``.
results:
A dictionary containing the following keys:
``COLOR``
A random colour (e.g. red, orange, ...).
``SIZE``
A random size (e.g. small, medium, ...).
"""
sleep(float(secs))
results = {}
Expand Down

0 comments on commit adea8f8

Please sign in to comment.