Debian Codegraph @

cylc/flow/task_qualifiers.py

raw
1 # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
2 # Copyright (C) NIWA & British Crown (Met Office) & Contributors.
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 """Built-in Cylc task qualifiers.
18
19 Qualifier, i.e. the bit after a colon in a graph string: <task>:<qualifer>
20 """
21
22 from cylc.flow.task_outputs import (
23 TASK_OUTPUTS,
24 TASK_OUTPUT_EXPIRED,
25 TASK_OUTPUT_SUBMITTED,
26 TASK_OUTPUT_SUBMIT_FAILED,
27 TASK_OUTPUT_STARTED,
28 TASK_OUTPUT_SUCCEEDED,
29 TASK_OUTPUT_FAILED,
30 TASK_OUTPUT_FINISHED,
31 )
32
33
34 # family qualifiers
35 QUAL_FAM_SUCCEED_ALL = "succeed-all"
36 QUAL_FAM_SUCCEED_ANY = "succeed-any"
37 QUAL_FAM_FAIL_ALL = "fail-all"
38 QUAL_FAM_FAIL_ANY = "fail-any"
39 QUAL_FAM_FINISH_ALL = "finish-all"
40 QUAL_FAM_FINISH_ANY = "finish-any"
41 QUAL_FAM_START_ALL = "start-all"
42 QUAL_FAM_START_ANY = "start-any"
43 QUAL_FAM_SUBMIT_ALL = "submit-all"
44 QUAL_FAM_SUBMIT_ANY = "submit-any"
45 QUAL_FAM_SUBMIT_FAIL_ALL = "submit-fail-all"
46 QUAL_FAM_SUBMIT_FAIL_ANY = "submit-fail-any"
47 QUAL_FAM_EXPIRE_ALL = "expire-all"
48 QUAL_FAM_EXPIRE_ANY = "expire-any"
49
50 # alternative (shorthand) qualifiers
51 ALT_QUALIFIERS = {
52 "expire": TASK_OUTPUT_EXPIRED,
53 "submit": TASK_OUTPUT_SUBMITTED,
54 "submit-fail": TASK_OUTPUT_SUBMIT_FAILED,
55 "start": TASK_OUTPUT_STARTED,
56 "succeed": TASK_OUTPUT_SUCCEEDED,
57 "fail": TASK_OUTPUT_FAILED,
58 "finish": TASK_OUTPUT_FINISHED,
59 }
60
61 # all built-in qualifiers
62 TASK_QUALIFIERS = (
63 *TASK_OUTPUTS,
64 *ALT_QUALIFIERS,
65 QUAL_FAM_SUCCEED_ALL,
66 QUAL_FAM_SUCCEED_ANY,
67 QUAL_FAM_FAIL_ALL,
68 QUAL_FAM_FAIL_ANY,
69 QUAL_FAM_FINISH_ALL,
70 QUAL_FAM_FINISH_ANY,
71 QUAL_FAM_START_ALL,
72 QUAL_FAM_START_ANY,
73 QUAL_FAM_SUBMIT_ALL,
74 QUAL_FAM_SUBMIT_ANY,
75 QUAL_FAM_SUBMIT_FAIL_ALL,
76 QUAL_FAM_SUBMIT_FAIL_ANY,
77 )