Skip to content

Commit 62dadfe

Browse files
committed
Docs: homogenise initial/final cycle point constraints descriptions
1 parent 07607d2 commit 62dadfe

File tree

1 file changed

+28
-34
lines changed

1 file changed

+28
-34
lines changed

cylc/flow/cfgspec/workflow.py

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,29 @@
7171
:ref:`See the migration guide <MajorChangesPlatforms>`.
7272
'''
7373

74+
CYCLE_POINT_CONSTRAINTS = '''
75+
Rules to allow only certain {0} datetime cycle points.
76+
77+
.. admonition:: Use Case
78+
79+
Writing a workflow where users may change the {0}
80+
cycle point, but where only some {0} cycle points are
81+
reasonable.
82+
83+
Set by defining a list of truncated time points, which
84+
the {0} cycle point must match.
85+
86+
Examples:
87+
88+
- ``T00, T06, T12, T18`` - only at 6 hourly intervals.
89+
- ``T-30`` - only at half-past an hour.
90+
- ``01T00`` - only at midnight on the first day of a month.
91+
92+
.. seealso::
93+
94+
:ref:`Recurrence tutorial <tutorial-inferred-recurrence>`.
95+
'''
96+
7497

7598
def global_default(text: str, config_path: str) -> str:
7699
"""Insert a link to this config item's global counterpart after the first
@@ -554,45 +577,16 @@ def get_script_common_text(this: str, example: Optional[str] = None):
554577
- ``+P1D`` - The initial cycle point plus one day.
555578
- ``2000 +P1D +P1Y`` - The year ``2000`` plus one day and one year.
556579
''')
557-
Conf('initial cycle point constraints', VDR.V_STRING_LIST, desc='''
558-
Rules to allow only some initial datetime cycle points.
559-
560-
.. admonition:: Use Case
561-
562-
Writing a workflow where users may change the initial
563-
cycle point, but where only some initial cycle points are
564-
reasonable.
565-
566-
Set by defining a list of truncated time points, which
567-
the initial cycle point must match.
568-
569-
Examples:
570-
571-
- ``T00, T06, T12, T18`` - only at 6 hourly intervals.
572-
- ``T-30`` - only at half-past an hour.
573-
- ``01T00`` - only at midnight on the first day of a month.
574-
575-
.. seealso::
576-
577-
:ref:`Recurrence tutorial <tutorial-inferred-recurrence>`.
580+
Conf('initial cycle point constraints', VDR.V_STRING_LIST,
581+
desc=CYCLE_POINT_CONSTRAINTS.format('initial') + dedent('''
578582
579583
.. note::
580584
581585
This setting does not coerce :cylc:conf:`[..]
582586
initial cycle point = now`.
583-
''')
584-
Conf('final cycle point constraints', VDR.V_STRING_LIST, desc='''
585-
Rules restricting permitted final cycle points.
586-
587-
In a cycling workflow it is possible to restrict the final cycle
588-
point by defining a list of truncated time points under the final
589-
cycle point constraints.
590-
591-
.. seealso::
592-
593-
:ref:`Recurrence tutorial <tutorial-inferred-recurrence>`.
594-
595-
''')
587+
'''))
588+
Conf('final cycle point constraints', VDR.V_STRING_LIST,
589+
desc=CYCLE_POINT_CONSTRAINTS.format('final'))
596590
Conf('hold after cycle point', VDR.V_CYCLE_POINT, desc=f'''
597591
Hold all tasks that pass this cycle point.
598592

0 commit comments

Comments
 (0)