Skip to content
Draft
Show file tree
Hide file tree
Changes from 150 commits
Commits
Show all changes
247 commits
Select commit Hold shift + click to select a range
933b142
Initial commit
mranst May 1, 2025
d46b22f
adding workflow string
mranst May 2, 2025
e1c3816
working
mranst May 2, 2025
e3e7d74
fixing section formatting
mranst May 2, 2025
3788c9c
redo task questions
mranst May 2, 2025
f661549
update task questions
mranst May 2, 2025
4d94820
update task questions again
mranst May 2, 2025
6e5fa8d
mostly working
mranst May 2, 2025
b69e974
Functional, fixing indentation
mranst May 5, 2025
71370dd
pycodestyle fixes
mranst May 5, 2025
d0d6a1c
Fix slurm formatting in runtime
mranst May 6, 2025
65d97a3
Simplify task runtime definitions
mranst May 6, 2025
c1bb1fc
remove print statement
mranst May 6, 2025
0ec6316
Fix slurm setting
mranst May 6, 2025
d584c5d
Remove duplicate import
mranst May 6, 2025
21828f4
Remove setter methods
mranst May 6, 2025
d00d382
Simplify formatting
mranst May 6, 2025
b699e87
Simplify workflows and suite configs
mranst May 7, 2025
5be480c
Clean up and introduce question order test
mranst Jun 9, 2025
7a88864
Initial commit
mranst Jun 10, 2025
d051a2d
Merge branch 'se/mranst/cylc_templating' into feature/mranst/workflow…
mranst Jun 10, 2025
78303bd
remove non-task tasks from tasks
mranst Jun 10, 2025
c3edeea
Merge branch 'se/mranst/cylc_templating' into feature/mranst/workflow…
mranst Jun 10, 2025
540e088
add test for jedi
mranst Jun 11, 2025
f9b5cd5
add compare command for jedi
mranst Jun 12, 2025
9c307f0
Add workflow pause and event status emails
mranst Jun 12, 2025
375b40f
Add message on pause and fix to messaging
mranst Jun 12, 2025
b38e0ac
pycodestyle fix
mranst Jun 13, 2025
eb83c5b
Update slurm code test
mranst Jun 16, 2025
f92d4c6
added some suites
mranst Jun 17, 2025
86c580f
add workflows
mranst Jun 17, 2025
776e2d8
add all suite workflows
mranst Jun 17, 2025
1743046
fix cycle times
mranst Jun 17, 2025
175210f
add all suites
mranst Jun 25, 2025
b8ea4ca
fixes
mranst Jul 7, 2025
991b9f0
Merge branch 'develop' into feature/mranst/workflows_for_comparison
mranst Jul 7, 2025
336a2c9
add cycling_varbc
mranst Jul 8, 2025
bb5984d
remove print statement
mranst Jul 8, 2025
904ffff
revise templating
mranst Jul 8, 2025
07111f2
revise templating for all suites
mranst Jul 8, 2025
70e5e4b
fixes for code tests
mranst Jul 8, 2025
53498ef
try to fix unused variables
mranst Jul 8, 2025
56862f3
functional code tests
mranst Jul 8, 2025
54ecaef
pycodestyle fixes
mranst Jul 8, 2025
f1c2fd2
Merge branch 'tmp' into feature/mranst/workflows_for_comparison
mranst Jul 8, 2025
24396f3
revise templating for 3dfgat_cycle
mranst Jul 8, 2025
14ca733
fix task_runtimes
mranst Jul 9, 2025
f1dd07b
fix cycling
mranst Jul 9, 2025
ab1fa20
fix for forecast_geos
mranst Jul 9, 2025
ab20791
fixes to suites
mranst Jul 9, 2025
ddb8f56
add comments
mranst Jul 9, 2025
e09e98e
test plots
mranst Jul 15, 2025
337110c
add imcrement comparison
mranst Jul 15, 2025
7e5d223
Functional comparison plots
mranst Jul 16, 2025
43e35f1
Add comments for comparison plots
mranst Jul 16, 2025
8164a42
pycodestyle fixes
mranst Jul 16, 2025
b8029e2
fix workflow
mranst Jul 18, 2025
7060a77
check for fgrep status
mranst Jul 18, 2025
cb29859
use cylc cycling
mranst Jul 30, 2025
3456872
rework fgrep task
mranst Jul 30, 2025
a15ce9a
Merge branch 'develop' into feature/mranst/workflows_for_comparison
mranst Jul 30, 2025
7eec497
Fix for missing cycle times
mranst Jul 31, 2025
4de85f1
Merge branch 'develop' into feature/mranst/workflows_for_comparison
mranst Aug 19, 2025
e2b3bca
Fix for localensembleda
mranst Aug 19, 2025
a2e4d40
Use datetime interval
mranst Aug 22, 2025
9217190
fixes for localensembleda
mranst Aug 22, 2025
ce104cb
Merge branch 'feature/mranst/workflows_for_comparison' of discover.nc…
mranst Aug 22, 2025
5f39fd1
Clean up eva comparison plots
mranst Aug 22, 2025
c1f8ddb
Add Jedi-log comparison plots
mranst Aug 22, 2025
19f6078
fixes for jedi_log
mranst Aug 22, 2025
8e74f79
add legend
mranst Aug 22, 2025
8071451
Link akbk*.nc4 to the fv3files/ directory (#602)
metdyn Jul 29, 2025
62878d9
SWELL now controls on peripheral files (#603)
rtodling Jul 30, 2025
f478178
Add task to get observations from GEOS location (#577)
mranst Jul 30, 2025
293ef9f
Automatically set window length for cycling (#604)
mranst Aug 1, 2025
176fda9
Fix for localensembleda
mranst Aug 19, 2025
2c8bd5c
Use datetime interval
mranst Aug 22, 2025
9a65fb4
fixes for localensembleda
mranst Aug 22, 2025
2272a65
Clean up eva comparison plots
mranst Aug 22, 2025
6958435
Add Jedi-log comparison plots
mranst Aug 22, 2025
2eb77e7
fixes for jedi_log
mranst Aug 22, 2025
0ff8e73
add legend
mranst Aug 22, 2025
59c96e3
Add jedi log parser for atmos
mranst Aug 22, 2025
82f1b82
Merge branch 'feature/mranst/workflows_for_comparison' of discover.nc…
mranst Aug 22, 2025
edab5f6
add increment for atmos
mranst Aug 22, 2025
e89cee4
fix
mranst Aug 22, 2025
ab12f72
fix transform
mranst Aug 22, 2025
41f5277
Fix layout
mranst Aug 22, 2025
ff5960d
add examples
mranst Aug 26, 2025
9521c2e
Merge branch 'develop' into feature/mranst/workflows_for_comparison
mranst Aug 26, 2025
04a5c37
remove flow.cylc
mranst Sep 18, 2025
3a15b8f
Merge branch 'develop' into feature/mranst/workflows_for_comparison
mranst Sep 18, 2025
d1888ec
add example to docs
mranst Sep 19, 2025
66e1f6c
add eva_capabilities workflow
mranst Sep 19, 2025
607bddb
correct eva_capabilities workflow
mranst Sep 19, 2025
3f7337c
fix sstagejedicycle
mranst Sep 19, 2025
ceff12d
replace defer_to_platform
mranst Sep 19, 2025
6ac3415
test fixes
mranst Sep 19, 2025
66f7597
simplify comparison suite
mranst Sep 22, 2025
d7e7ce9
add tier test output
mranst Sep 22, 2025
d9c718e
clean up tier test output
mranst Sep 22, 2025
94520dd
write to file
mranst Sep 22, 2025
fd1ac21
add new documentation
mranst Sep 23, 2025
8040b97
Add diff and tolerances for residual norms
mranst Sep 24, 2025
c4d17cc
clean up
mranst Sep 24, 2025
ac7551e
Add docs for csh interactive install (#631)
mranst Sep 23, 2025
35d98ab
Merge branch 'develop' into feature/mranst/workflows_for_comparison
mranst Sep 24, 2025
de3ed0d
test fixes
mranst Sep 24, 2025
14ef1a7
Merge branch 'develop' into feature/mranst/workflows_for_comparison
mranst Sep 25, 2025
eee3ff7
add log comparison
mranst Sep 26, 2025
8a307bc
revise number of iterations
mranst Sep 30, 2025
b76b1b2
add window_length
mranst Sep 30, 2025
a08c1fe
simplify 3dvar:
mranst Oct 9, 2025
26a51a1
fixes
mranst Oct 9, 2025
7685720
runtime
mranst Oct 9, 2025
2b31496
fixes
mranst Oct 9, 2025
fa6827c
add flow.cylc
mranst Oct 9, 2025
0ba365e
add cycle_times
mranst Oct 10, 2025
76ead50
fix cycle_times
mranst Oct 10, 2025
f29416b
revert workflows
mranst Oct 10, 2025
e9f8fcf
create experiment
mranst Oct 10, 2025
2b5d385
fix 3dfgat_cycle
mranst Oct 10, 2025
b1ea5e1
code test fixes
mranst Oct 10, 2025
0745061
Merge branch 'develop' into feature/mranst/workflows_for_comparison_r…
mranst Oct 10, 2025
36af1d5
fix cycles
mranst Oct 10, 2025
c12d2cc
fix cycle_times
mranst Oct 10, 2025
9baf275
refactor 3dvar
mranst Oct 15, 2025
a10fe65
fixes
mranst Oct 15, 2025
ca80be7
updates
mranst Oct 16, 2025
a345f53
rework
mranst Oct 24, 2025
64f6d07
migrate all files
mranst Oct 28, 2025
3e74019
fix task runtime section
mranst Oct 28, 2025
f3da5e3
Refactor into task_attributes class
mranst Oct 30, 2025
ad01ab6
fixes for all suites
mranst Oct 30, 2025
c4ba559
change names of task_spec
mranst Oct 30, 2025
ee07db0
clean up
mranst Nov 7, 2025
a902260
refactor self.tasks
mranst Nov 7, 2025
cac1b7b
code style fix
mranst Nov 7, 2025
de089eb
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Nov 14, 2025
90ea975
fixes to flow
mranst Nov 14, 2025
bdb5fda
Add docs for new method
mranst Nov 17, 2025
0b6a231
Add create_task_config
mranst Nov 19, 2025
043d34e
fixes
mranst Nov 20, 2025
5de27b6
code test fixes
mranst Nov 20, 2025
f7165e9
Add cwd flag
mranst Nov 20, 2025
eac5c03
Fixes
mranst Nov 20, 2025
9a4bd06
fix input_method
mranst Nov 20, 2025
b0e63e4
Fixes for questions
mranst Nov 20, 2025
6432737
Fix cycle times
mranst Nov 20, 2025
f308408
Fix for comparison suites
mranst Nov 20, 2025
1ea1be3
add time limit to slurm directives
mranst Nov 24, 2025
555e810
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Dec 16, 2025
26b6fa1
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Dec 16, 2025
33f911f
address comments
mranst Dec 16, 2025
ca92d9f
pycodestyle fix
mranst Dec 17, 2025
038ddb9
Fix default_value
mranst Dec 17, 2025
7ddae1c
Remove task questions
mranst Dec 18, 2025
bf1eaf2
Rework settings files
mranst Dec 18, 2025
2b8f8ff
Refactor location of task attributes
mranst Dec 23, 2025
7332d63
Rename task_setup
mranst Dec 23, 2025
ec17774
Fix
mranst Dec 23, 2025
9c8dc2b
Address comments
mranst Dec 23, 2025
1f897cf
code style fixes
mranst Dec 23, 2025
a136729
Add comments and refactoring changes
mranst Dec 29, 2025
db60a4b
Fixes for refactoring
mranst Dec 29, 2025
6399bca
Add docstrings
mranst Dec 29, 2025
a304a1d
pycodestyle fix
mranst Dec 29, 2025
256fd33
Add docstrings
mranst Dec 29, 2025
4872c61
pycodestyle fix
mranst Dec 29, 2025
8dd603c
comparison test fixes
mranst Dec 30, 2025
862b1b7
refactor questions
mranst Dec 30, 2025
e9304bb
Update docs
mranst Dec 30, 2025
57730a2
Refactor email address
mranst Dec 30, 2025
f4f677c
Don't use unset email address
mranst Dec 30, 2025
dc92d3b
Update docs/examples/templating_workflows.md
mranst Jan 7, 2026
6351224
Update slurm settings
mranst Jan 7, 2026
f192652
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Jan 8, 2026
10b55bc
pycodestyle fix
mranst Jan 8, 2026
46143e3
working
mranst Jan 12, 2026
a6cacfa
Refactor
mranst Jan 16, 2026
5fa08bf
Refactor
mranst Jan 16, 2026
7ec1c51
syntax fix
mranst Jan 16, 2026
688cfd9
fixes for flow.cylc
mranst Jan 16, 2026
020838d
discover
mranst Jan 20, 2026
c48a32e
try registry
mranst Jan 20, 2026
77d5b1f
fixes
mranst Jan 20, 2026
c7477c9
register all tasks
mranst Jan 20, 2026
8d34b15
fix stage_jedi_cycle
mranst Jan 20, 2026
c0839a7
add registry to all tasks
mranst Jan 20, 2026
c334659
Add docs
mranst Jan 20, 2026
3bb0b6d
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Jan 20, 2026
d329a39
Move jedi_bundle import
mranst Jan 20, 2026
47462f5
fix import
mranst Jan 20, 2026
2fc2e18
Move build imports
mranst Jan 20, 2026
a9007b2
code test fix
mranst Jan 20, 2026
8cb8012
Code test fix
mranst Jan 20, 2026
901bb5a
fix for jedi_bundle
mranst Jan 20, 2026
c20689b
Increase time limit for build_jedi
mranst Jan 21, 2026
691444b
cast to list
mranst Jan 27, 2026
275647b
Fix override bug and use ruamel
mranst Jan 27, 2026
f4a27c7
Type hint fixes
mranst Jan 27, 2026
613e31d
Add docstrings
mranst Jan 27, 2026
9ebf6fd
Remove flow.cylc
mranst Jan 27, 2026
f745458
Add type annotations and remove registry
mranst Jan 27, 2026
cb3753c
add comments for local imports
mranst Jan 27, 2026
537afb6
Update adding a suite docs
mranst Jan 27, 2026
2b15bd4
Resolve override dictionary
mranst Jan 27, 2026
0a92f44
Code test fixes
mranst Jan 27, 2026
3d15d48
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Jan 27, 2026
90ded9a
Code test fixes
mranst Jan 27, 2026
8476c87
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Jan 27, 2026
a6fd35a
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Jan 29, 2026
cdddd54
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Jan 29, 2026
d094ac1
Fix for ensemble
mranst Feb 5, 2026
dabe9b2
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Feb 5, 2026
d72b275
Refactor names of time_limit and is_model
mranst Feb 6, 2026
6af195b
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Feb 18, 2026
a232474
Code test fixes
mranst Feb 18, 2026
d490b7c
pycodestyle
mranst Feb 18, 2026
1071286
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Feb 27, 2026
fd52380
Refactor question_defaults to configuration
mranst Feb 27, 2026
fad4afa
add configuration question defaults
mranst Feb 27, 2026
5f7c031
move discover_plugins
mranst Feb 27, 2026
7cde879
Refactor task defaults to allow suite override
mranst Mar 2, 2026
ade5600
Update docs for new locations
mranst Mar 2, 2026
dcd9caf
add docstrings
mranst Mar 2, 2026
f11c84e
Switch suite config method
mranst Mar 2, 2026
4c31865
Refactor suite configs
mranst Mar 2, 2026
66ef0d0
Refactor 3dvar
mranst Mar 2, 2026
2d1cf08
Refactor suite configs
mranst Mar 2, 2026
13674b6
Refactor suite configs to be more straightforward
mranst Mar 3, 2026
06e4c86
Add files for merge with develop
mranst Mar 3, 2026
8e1b8f3
Register workflows
mranst Mar 3, 2026
90c3063
Fix convert_ncdiags
mranst Mar 3, 2026
02c5885
Update docs
mranst Mar 3, 2026
583f6aa
Fix code tests
mranst Mar 3, 2026
36903ef
Refactor question defaults
mranst Mar 3, 2026
6ca1791
Update docs for question defaults
mranst Mar 3, 2026
898ed8e
Refactor suite_attributes.py
mranst Mar 3, 2026
13411e2
code test fixes
mranst Mar 3, 2026
f2a8d16
Remove unused list_name
mranst Mar 3, 2026
aa468bb
Remove get_suites
mranst Mar 3, 2026
433ba0d
refactor suite attributes
mranst Mar 3, 2026
904e679
Fix task minimum
mranst Mar 3, 2026
2014fd1
Use subprocess and check exit status for mksi
mranst Mar 3, 2026
9123319
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Mar 3, 2026
c01685a
Merge branch 'develop' into se/mranst/workflow_templating_redux2
mranst Mar 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions docs/examples/templating_workflows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Templating cylc workflows within swell
The `flow.cylc` file informs the `Cylc` workflow engine on how to run an experiment. This includes the order in which tasks should be run, and the scripts and environment variables necessary for each task. Templating a workflow within Swell previously used `jinja2` templating on a file named `flow.cylc` under each suite. This has been replaced with an approach that uses a python class to manipulate strings to generated the `flow.cylc` used in the experiment. This allows for more complex logic to be performed in generating the workflow, but also may be confusing to users. This documentation serves to explain the new method of templating workflows under these changes.

## Cylc sections

The `flow.cylc` that is generated under this method is not much different from the one generated before, and users shouldn't notice a difference when it comes to creating an experiment, using overrides, etc. When creating an experiment, `swell` consults a file `src/swell/suites/<suite>/workflow.py` on how to construct the suite. This file should be an extension of the `CylcWorkflow` class (defined in `src/swell/utilities/cylc_workflow.py`). The method `get_workflow_string` is called to return a string which fills the contents of the `flow.cylc` file. Overriding this method is used to manually specify the contents of the file. Typically, the graph section is templated in `jinja2`, and the runtime sections for each task are generated using swell's `TaskAttribute` class. However, the entire `flow.cylc` file can be templated in `jinja`, if necessary.


## Tasks and the runtime section

Swell will parse the graph section, which is constructed first, to obtain the tasks which are used by the experiment. It will then build the runtime section by consulting `src/swell/tasks/task_attributes.py`. Since swell tasks broadly fall into only a few categories (model-dependent or independent, cycling or non-cycling) that do not differ much between suites, they are easily abstracted into a `Task` class. This class will dynamically set attributes such as messaging parameters and slurm settings.

```python
class CloneJedi(Task):
def set_attributes(self):
self.question_list = QuestionList([
qd.bundles(),
qd.existing_jedi_source_directory(),
qd.existing_jedi_source_directory_pinned(),
qd.jedi_build_method()
])


class EvaObservations(Task):
def set_attributes(self):
self.time_limit = True
self.is_cycling = True
self.is_model = True
self.slurm = {}
self.question_list = QuestionList([
background_crtm_obs,
qd.marine_models(),
qd.observing_system_records_path(),
qd.window_offset(),
qd.marine_models(),
])
```

Attributes are set by override the `set_attributes` method in `Task`. This has been combined with the previously-used `task_questions.py` for simplicity. Here, the tags `is_cycling` and `is_model` are used to specify what tags the task needs to be appended with in the runtime section. These are set to `False` by default. Tasks with a specified `slurm` dictionary (rather than set to null, as by default) will use their contents to build the `directives` section.

```
[[EvaObservations-geos_marine]]
script = "swell task EvaObservations $config -d $datetime -m geos_marine"
platform = nccs_discover_sles15
execution time limit = PT30M
[[[directives]]]
--job-name = EvaObservations-geos_marine
--qos = allnccs
--nodes = 1
--ntasks-per-node = 64
--constraint = mil
--no-requeue =
--account = <account>
```

This can be used to set task-specific defaults in `task_attributes.py`, rather than being set in `slurm.py`:

```python
class RunJediConvertStateSoca2ciceExecutable(Task):
def set_attributes(self):
self.is_cycling = True
self.is_model = True
self.time_limit = True
self.slurm = {'nodes': 1}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity/completeness, suggest stating exactly which task-specific defaults are being overwritten.

Suggested change
This can be used to set task-specific defaults in `task_attributes.py`, rather than being set in `slurm.py`:
```python
class RunJediConvertStateSoca2ciceExecutable(Task):
def set_attributes(self):
self.is_cycling = True
self.is_model = True
self.time_limit = True
self.slurm = {'nodes': 1}
```
This can be used to set task-specific defaults in `task_attributes.py`, rather than being set in `slurm.py`. For example, the task below defaults to slurm setting `--nodes=1`:
```python
class RunJediConvertStateSoca2ciceExecutable(Task):
def set_attributes(self):
self.is_cycling = True
self.is_model = True
self.time_limit = True
self.slurm = {'nodes': 1}


This supports setting platform-specific overrides, for example:

```python
class RunJediConvertStateSoca2ciceExecutable(Task):
def set_attributes(self):
self.is_cycling = True
self.is_model = True
self.time_limit = True
self.slurm = {'all': 1,
'nccs_discover_cascade': 2}
```

On the `nccs_discover_cascade` platform, `nodes` will be set as 2, but on any other platform it will be 1. User overrides will still work as they did previously.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ cycle_times:
default_value: ['T00', 'T06', 'T12', 'T18']
options: ['T00', 'T06', 'T12', 'T18']

cycling_varbc:
default_value: false
options:
- true
- false

ensemble_hofx_strategy:
default_value: 'serial'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ clean_patterns:
- '*.txt'
- logfile.*.out

cycling_varbc:
default_value: false
options:
- true
- false

ensemble_hofx_packets:
default_value: 2
options: None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ ensemble_hofx_packets:

skip_ensemble_hofx:
default_value: true

marine_models:
default_value:
- mom6
- cice6
options:
- mom6
- cice6
- bgc
- ww3
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ jedi_forecast_model:
options:
- NA

marine_models:
default_value:
- mom6
- cice6
options:
- mom6
- cice6
- bgc
- ww3

minimizer:
default_value: RPCG
options:
Expand Down
Loading
Loading