Skip to content
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

Autodoc built-in xtrigger functions #673

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
autosummary_generate_overwrite = True
autosummary_imported_members = False

# Autodoc type hints can look very messy if they are included in the signature,
# so we only include them in the description instead:
autodoc_typehints = 'description'

# Mapping to other Sphinx projects we want to import references from.
# NOTE: To search available references, use:
# $ python -m sphinx.ext.intersphinx <url>/objects.inv | less
Expand Down
14 changes: 7 additions & 7 deletions src/user-guide/writing-workflows/external-triggers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ in :ref:`ClockTriggerTasks`.
Clock triggers, unlike other trigger functions, are executed synchronously in
the main process. The clock trigger function signature looks like this:

..
NOTE: don't use autofunction here because cylc.flow.xtriggers.wall_clock
has a different signature, and instead there is special handling
in XtriggerManager

.. code-block:: python

wall_clock(offset=None)
Expand Down Expand Up @@ -130,10 +135,7 @@ tasks off of remote task statuses or messages in other workflows.

The workflow state trigger function signature looks like this:

.. code-block:: python

workflow_state(workflow, task, point, offset=None, status='succeeded',
message=None, cylc_run_dir=None, debug=False)
.. autofunction:: cylc.flow.xtriggers.workflow_state.workflow_state

The first three arguments are compulsory; they single out the target workflow name
(``workflow``) task name (``task``) and cycle point
Expand Down Expand Up @@ -344,9 +346,7 @@ time (useful for testing the effect of a long-running trigger function
- which should be avoided) and has a configurable random chance of
success. The function signature is:

.. code-block:: python

xrandom(percent, secs=0, _=None, debug=False)
.. autofunction:: cylc.flow.xtriggers.xrandom.xrandom

The ``percent`` argument sets the odds of success in any given call;
``secs`` is the number of seconds to sleep before returning; and the
Expand Down
Loading