From a2209d35a50de78312d01a767727d2ce8fdd46bf Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Tue, 25 Feb 2025 16:33:19 +0000 Subject: [PATCH 1/2] Update nitpick ignore --- src/conf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/conf.py b/src/conf.py index 9b535ae8ed..f89da2083c 100644 --- a/src/conf.py +++ b/src/conf.py @@ -142,6 +142,11 @@ ('py:class', 'SubFuncContext'), ('py:exc', 'ISO8601SyntaxError'), ('py:exc', 'StrftimeSyntaxError'), + ('py:class', 'ResponseDict'), +] +nitpick_ignore_regex = [ + # intersphinx has trouble with pyzmq classes: + ('py:class', r'zmq\.asyncio\.\w+') ] # List of patterns, relative to source directory, that match files and @@ -164,11 +169,6 @@ 'https?://matrix.to/.*#.*', ] -nitpick_ignore_regex = [ - # intersphinx has trouble with pyzmq classes: - ('py:class', r'zmq\.asyncio\.\w+') -] - # -- Options for Slides output ---------------------------------------------- slide_theme = 'single-level' From a9674f239984517a877d0739990f2cc24f20fbae Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Wed, 12 Feb 2025 15:25:13 +0000 Subject: [PATCH 2/2] examples: document expiry workflow design patterns --- .../writing-workflows/scheduling.rst | 82 ++++++++++++++++--- 1 file changed, 71 insertions(+), 11 deletions(-) diff --git a/src/user-guide/writing-workflows/scheduling.rst b/src/user-guide/writing-workflows/scheduling.rst index df61a140ef..36896724b2 100644 --- a/src/user-guide/writing-workflows/scheduling.rst +++ b/src/user-guide/writing-workflows/scheduling.rst @@ -1507,14 +1507,62 @@ to the task cycle point. Clock-Expire Triggers ^^^^^^^^^^^^^^^^^^^^^ -Tasks can be configured to :term:`expire ` if the wall clock -time exceeds some offset from their cycle point. +Tasks can be configured to :term:`expire ` if the real-world +(wall clock) time exceeds some offset from their cycle point. +Task expiration is configured with +:cylc:conf:`[scheduling][special tasks]clock-expire` using a syntax like +:cylc:conf:`clock-trigger <[scheduling][special tasks]clock-trigger>` +with a datetime offset relative to cycle point. +The offset should be positive to make the task expire if the wallclock time +has gone beyond the cycle point. + +In this example: + +* The task ``foo`` is configured to expire when the wall clock + time passes the cycle time: +* Whereas ``bar`` is configured to expire one hour *after* the cycle time. + +.. code-block:: cylc -The associated ``:expire`` :term:`output ` can be used to + [scheduling] + [[special tasks]] + clock-expire = foo, bar(PT1H) + +So, in the cycle ``2000-01-01T00:00Z``: + +* ``foo`` would expire at ``2000-01-01T00:00Z``. +* ``bar`` would expire at ``2000-01-01T01:00Z``. + +Only waiting tasks can expire, :term:`active tasks ` will not be +killed if they pass their configured ``clock-expire`` time. + +When a task expires, it produces the ``expired`` :term:`output`. +This can be used to trigger other tasks. It must be marked as an :term:`optional output`, i.e. expiry cannot be :term:`required `. +In this example: + +* ``foo`` will not run before the wall clock time. +* ``foo`` will expire if it does not start running within 6 hours of the wall + clock time being reached. +* If ``foo`` runs, the task ``bar`` will run after. +* If ``foo`` expires, the task ``baz`` will run after. + +.. code-block:: cylc + + [scheduling] + initial cycle point = 2000 + [[special tasks]] + clock-expire = foo(PT6H) + [[graph]] + P1D = """ + @wall_clock => foo + foo => bar + foo:expired? => baz + """ + Family triggers are also provided for task expiry: .. code-block:: cylc-graph @@ -1523,19 +1571,31 @@ Family triggers are also provided for task expiry: FAM:expire-all? => baz FAM:expire-any? => qux -Task expiration is configured with -:cylc:conf:`[scheduling][special tasks]clock-expire` using a syntax like -:cylc:conf:`clock-trigger <[scheduling][special tasks]clock-trigger>` -with a datetime offset relative to cycle point. - -The offset should be positive to make the task expire if the wallclock time -has gone beyond the cycle point. - .. warning:: The scheduler can only determine that a task has expired once it enters the :term:`n=0 window `. + This means that at least one of a task's prerequisites must be satisfied + before the task may expire. + + So in the following example, the task ``b`` will only expire, **after** + the task ``a`` has succeeded: + + .. code-block:: cylc + + [scheduling] + initial cycle point = 2000 + [[special tasks]] + clock-expire = b + [[graph]] + P1D = a => b + +.. seealso:: + + For worked examples of workflows that use expiry, see the + :ref:`examples section`. + .. _WorkflowConfigExternalTriggers: