Skip to content

Commit e552763

Browse files
authored
Docs: homogenise initial/final cycle point constraints descriptions (#6812)
1 parent a7988c0 commit e552763

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
@@ -92,6 +92,29 @@
9292
:ref:`See the migration guide <MajorChangesPlatforms>`.
9393
'''
9494

95+
CYCLE_POINT_CONSTRAINTS = '''
96+
Rules to allow only certain {0} datetime cycle points.
97+
98+
.. admonition:: Use Case
99+
100+
Writing a workflow where users may change the {0}
101+
cycle point, but where only some {0} cycle points are
102+
reasonable.
103+
104+
Set by defining a list of truncated time points, which
105+
the {0} cycle point must match.
106+
107+
Examples:
108+
109+
- ``T00, T06, T12, T18`` - only at 6 hourly intervals.
110+
- ``T-30`` - only at half-past an hour.
111+
- ``01T00`` - only at midnight on the first day of a month.
112+
113+
.. seealso::
114+
115+
:ref:`Recurrence tutorial <tutorial-inferred-recurrence>`.
116+
'''
117+
95118

96119
def global_default(text: str, config_path: str) -> str:
97120
"""Insert a link to this config item's global counterpart after the first
@@ -583,45 +606,16 @@ def get_script_common_text(this: str, example: Optional[str] = None):
583606
- ``+P1D`` - The initial cycle point plus one day.
584607
- ``2000 +P1D +P1Y`` - The year ``2000`` plus one day and one year.
585608
''')
586-
Conf('initial cycle point constraints', VDR.V_STRING_LIST, desc='''
587-
Rules to allow only some initial datetime cycle points.
588-
589-
.. admonition:: Use Case
590-
591-
Writing a workflow where users may change the initial
592-
cycle point, but where only some initial cycle points are
593-
reasonable.
594-
595-
Set by defining a list of truncated time points, which
596-
the initial cycle point must match.
597-
598-
Examples:
599-
600-
- ``T00, T06, T12, T18`` - only at 6 hourly intervals.
601-
- ``T-30`` - only at half-past an hour.
602-
- ``01T00`` - only at midnight on the first day of a month.
603-
604-
.. seealso::
605-
606-
:ref:`Recurrence tutorial <tutorial-inferred-recurrence>`.
609+
Conf('initial cycle point constraints', VDR.V_STRING_LIST,
610+
desc=CYCLE_POINT_CONSTRAINTS.format('initial') + dedent('''
607611
608612
.. note::
609613
610614
This setting does not coerce :cylc:conf:`[..]
611615
initial cycle point = now`.
612-
''')
613-
Conf('final cycle point constraints', VDR.V_STRING_LIST, desc='''
614-
Rules restricting permitted final cycle points.
615-
616-
In a cycling workflow it is possible to restrict the final cycle
617-
point by defining a list of truncated time points under the final
618-
cycle point constraints.
619-
620-
.. seealso::
621-
622-
:ref:`Recurrence tutorial <tutorial-inferred-recurrence>`.
623-
624-
''')
616+
'''))
617+
Conf('final cycle point constraints', VDR.V_STRING_LIST,
618+
desc=CYCLE_POINT_CONSTRAINTS.format('final'))
625619
Conf('hold after cycle point', VDR.V_CYCLE_POINT, desc=f'''
626620
Hold all tasks that pass this cycle point.
627621

0 commit comments

Comments
 (0)