Skip to content

Commit 83630de

Browse files
Merge pull request #614 from cylc/8.1.x
8.1.x
2 parents 84bb4b5 + ff1d195 commit 83630de

File tree

3 files changed

+102
-1
lines changed

3 files changed

+102
-1
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ requests_).
5353
- Alex Pletzer
5454
- Yinjing Lin
5555
- David Sutherland
56+
- Thomas Coleman
5657
<!-- end-shortlog -->
5758

5859
(All contributors are identifiable with email addresses in the git version
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
Parameters
2+
==========
3+
4+
.. admonition:: does this change affect me?
5+
:class: tip
6+
7+
If you use Cylc parameters with negative offsets (e.g. ``foo<x-1>``).
8+
9+
10+
Overview
11+
--------
12+
13+
There has been a subtle change in the way negative offsets are handled in parameters.
14+
15+
16+
Example
17+
-------
18+
19+
If you have a parameter ``x`` with the values 1, 2 & 3:
20+
21+
.. code-block:: cylc
22+
23+
[task parameters]
24+
x = 1..3
25+
26+
And use it like so:
27+
28+
.. code-block:: cylc-graph
29+
30+
a<x-1> => b<x> => c<x>
31+
32+
There is some ambiguity about how this should be interpreted when ``x=1``
33+
because ``<x-1>`` would be ``0`` which is not a valid value for the parameter
34+
``x``.
35+
36+
Cylc 7 removed the part of the expression which was out of range resulting in a
37+
partial evaluation of that line:
38+
39+
.. code-block:: cylc-graph
40+
41+
b_x1 => c_x1 # x=1
42+
a_x1 => b_x2 => c_x2 # x=2
43+
a_x2 => b_x3 => c_x3 # x=3
44+
45+
Whereas Cylc 8 will remove everything after the first out-of-range parameter - ``<x-1>`` (so the entire line for this example):
46+
47+
.. code-block:: cylc-graph
48+
49+
a_x1 => b_x2 => c_x2 # x=2
50+
a_x2 => b_x2 => c_x2 # x=3
51+
52+
53+
Migration
54+
---------
55+
56+
If your workflow depends on the Cylc 7 behaviour, then the solution is
57+
to break the expression into two parts which Cylc will then evaluate separately.
58+
59+
.. code-block:: diff
60+
61+
- a<x-1> => b<x> => c<x>
62+
+ a<x-1> => b<x>
63+
+ b<x> => c<x>
64+
65+
Resulting in:
66+
67+
.. code-block:: cylc-graph
68+
69+
# a<x-1> => b<x>
70+
a_x1 => a_x2 # x=2
71+
a_x2 => a_x3 # x=3
72+
73+
# b<x> => c<x>
74+
b_x1 => c_x1 # x=1
75+
b_x2 => c_x2 # x=2
76+
b_x3 => c_x3 # x=3
77+
78+
79+
Line Breaks
80+
-----------
81+
82+
Note that these expressions are all equivalent:
83+
84+
.. list-table::
85+
:class: grid-table
86+
87+
* - .. code-block::
88+
89+
a<x-1> => b<x> => c<x>
90+
91+
- .. code-block::
92+
93+
a<x-1> =>
94+
b<x> =>
95+
c<x>
96+
97+
- .. code-block::
98+
99+
a<x-1> => b<x> => \
100+
c<x>

src/user-guide/task-implementation/job-scripts.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ Task messages are validated by
189189
Aborting Job Scripts on Error
190190
-----------------------------
191191

192-
Job scripts use ``set -x`` to abort on any error, and trap ERR, EXIT, and
192+
Job scripts use ``set -e`` to abort on any error, and trap ERR, EXIT, and
193193
SIGTERM to send task failed messages back to the :term:`scheduler` before
194194
aborting. Other scripts called from job scripts should therefore abort with
195195
standard non-zero exit status on error, to trigger the job script error trap.

0 commit comments

Comments
 (0)