Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
209 changes: 82 additions & 127 deletions docs/adding_a_suite.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The `root` section defines actions and variables shared by all tasks. Note that

## How the experiment is created

When an experiment is created using `swell create <suite>`, a dictionary of questions is pieced together from questions associated with the suite and its member tasks. Answers for these questions are set either from default configurations, from user input on the command line, or overridden from a specified file. In a complex process, the answers provided are then used to generate the `experiment.yaml` and the experiment's `flow.cylc file.
When an experiment is created using `swell create <suite>`, a dictionary of questions is pieced together from questions associated with the suite and its member tasks. Answers for these questions are set either from default configurations, from user input on the command line, or overridden from a specified file. In a complex process, the answers provided are then used to generate the `experiment.yaml` and the experiment's `workflow.py` file.

# Creating a Suite

Expand All @@ -145,19 +145,20 @@ Creating visualizations such as flowcharts may help in designing workflows.
In practice, there are three major steps towards creating a suite. Completing all of these steps is necessary to make the suite work, so these steps will likely be done iteratively/non-linearly:

1. Write the tasks.
2. Create the `flow.cylc` file.
2. Create the `workflow.py` file.
3. Add the appropriate suite and task question lists.

More detailed instructions and examples for these steps follows in this section.

### Writing tasks

Swell has a variety of tasks, many of which are shared across suites. Tasks in Swell are defined as classes which extend the `taskBase` parent class, which has many helpful functions and attributes. When a task is run by swell, it calls the `execute` function.
Swell has a variety of tasks, many of which are shared across suites. Tasks in Swell are defined as classes which extend the `taskBase` parent class, which has many helpful functions and attributes. When a task is run by swell, it calls the `execute` function. Information on how to run the task and the parameters the task needs are specified in the `TaskSetup` class.

Calls to parameters are made using either functions of `taskBase`, for more common parameters, or using `self.config.<parameter>`.

### Example Swell Task
```python

class CloneGeosMksi(taskBase):

def execute(self) -> None:
Expand All @@ -179,40 +180,42 @@ class CloneGeosMksi(taskBase):
```
This example shows the basics of writing a task, including task definition and the execute function. The current model is accessed by the `self.get_model()` function, inherited from `taskBase`. The variables `path_to_geos_mksi`, and `tag`, are pulled from the experiment configuration, which is sourced from the `experiment.yaml`.

Tasks that have a slurm requirement need to be specified in `src/swell/utilities/slurm.py`.
The `TaskSetup` class informs swell how to construct the task's cylc parameters, as well as the questions that are used by the task. The `TaskSetup` class for `CloneGeosMksi` looks like the following:

For debugging purposes, it may be easier to first create and test some tasks outside of Swell, and then port them to Swell by changing relevant variables and path specifications. Alternatively, `experiment.yaml` can be populated manually and tested using `swell task <task> experiment.yaml`.
```python

### Creating the flow.cylc template
task_name = 'CloneGeosMksi'
@task_attributes.register(task_name)
class Setup(TaskSetup):
def set_attributes(self):
self.base_name = task_name
self.model_dep = True
self.questions = [
qd.observing_system_records_mksi_path(),
qd.observing_system_records_mksi_path_tag()
]

For more detailed information on cylc workflows, see the [cylc documentation](https://cylc.github.io/cylc-doc/latest/html/index.html). Existing Swell suite workflows can also provide useful examples to consider.
```

Suite workflows are stored in `src/swell/suites/<suite>`.
The `set_attributes` abstract method is used to set values for the class. The `self.questions` list sets needed question parameters for the config. Slurm requirements are also set in the the `TaskSetup`. For more information, see documentation in `src/swell/tasks/base/task_setup.py`.

The experiment `flow.cylc` file is generated from a suite template using a `jinja2` process. For example, here is part of a suite template, versus a filled-in experiment `flow.cylc`. During creation, specified questions are used to fill in the template:
For debugging purposes, it may be easier to first create and test some tasks outside of Swell, and then port them to Swell by changing relevant variables and path specifications. Alternatively, `experiment.yaml` can be populated manually and tested using `swell task <task> experiment.yaml`.

```
[scheduling]
### Creating the flow.cylc template

initial cycle point = {{start_cycle_point}}
final cycle point = {{final_cycle_point}}
runahead limit = {{runahead_limit}}
```
```
[scheduling]
For more detailed information on cylc workflows, see the [cylc documentation](https://cylc.github.io/cylc-doc/latest/html/index.html). Existing Swell suite workflows can also provide useful examples to consider.

initial cycle point = 2021-07-01T12:00:00Z
final cycle point = 2021-07-01T12:00:00Z
runahead limit = P4
```
Suite workflows are stored in `src/swell/suites/<suite>/workflow.py`.

The experiment `flow.cylc` file is generated from a suite template. This is handled through the `CylcWorkflow` task and generally consists of two steps, setting the graph and iterating through the tasks to generate. For more information, see the documentation for `CylcWorkflow` under `src/swell/utilities/cylc_workflow.py` and example suites.

For initial development/testing purposes, it may be easier to create a `flow.cylc` using hard-coded values, then replace these with `jinja2` templated values as the suite nears completion.

## Suite and task questions

### Question Objects

Questions for swell are stored as dataclass instances, in the file `src/swell/utilities/question_defaults.py`. Dataclasses allow for simple declaration of data fields, and powerful type checking capabilities. Each question is an extension of the `SuiteQuestion` or `TaskQuestion` class, which are extensions of the `SwellQuestion` parent:
Questions for swell are stored as dataclass instances, in the file `src/swell/configuration/question_defaults.py`. Dataclasses allow for simple declaration of data fields, and powerful type checking capabilities. Each question is an extension of the `SuiteQuestion` or `TaskQuestion` class, which are extensions of the `SwellQuestion` parent:

```python
@dataclass
Expand Down Expand Up @@ -274,121 +277,73 @@ question = existing_jedi_build_directory(options=['example1', 'example2'])
Each individual suite and most tasks have an associated list of questions which are used to create the experiment.

Suite question lists are stored in `src/swell/suites/<suite>/suite_config.py`
Task question lists are stored in `src/swell/tasks/task_questions.py`

`QuestionList` objects store and handle questions in an object-oriented manner. They can store questions directly, or store other lists to use their questions. Here is an example of a question list for a task:
Task question lists are stored in `src/swell/tasks/<task>.py`

```python
BuildJediByLinking = QuestionList(
list_name="BuildJediByLinking",
questions=[
qd.existing_jedi_build_directory(),
qd.existing_jedi_build_directory_pinned(),
qd.jedi_build_method()
]
)
```
`QuestionList` objects store and handle questions in an object-oriented manner. They can store questions directly, or store other lists to use their questions.

During experiment creation, Swell scans the suite's `flow.cylc` file to find all of the tasks used in the workflow. It then finds the corresponding task lists in `src/swell/tasks/task_questions.py`, and fits together a list of uniquely named questions from all of the lists. Questions have a priority depending on order. In the case of duplicate questions, those further DOWN the list take priority. For this reason, it is NOT RECOMMENDED to set different default values for tasks in `task_questions.py`, since questions may be overridden by a questions in a different task.
During experiment creation, Swell consults the suite's `workflow.py` file to find all of the tasks used in the workflow. It then finds the corresponding task lists in the `TaskSetup` object located in `src/swell/tasks/<task>.py`, and fits together a list of uniquely named questions from all of the lists. Questions have a priority depending on order. In the case of duplicate questions, those further DOWN the list take priority. For this reason, it is NOT RECOMMENDED to set different default values for questions listed in tasks, since questions may be overridden by a questions in a different task.

In this question infrastructure, **suites take priority over tasks**. Any question specified in a suite configuration will override the default value for a question in one of its member tasks. This allows for easily setting different configurations for suites without having to specify redundant questions. For ease of use, model-dependent questions can be assigned directly in their respective lists.

Consider the following example of suite questions for `3dvar` (in python, variable names cannot begin with digits):

```python
from swell.utilities.question_defaults import QuestionDefaults as qd
from swell.suites.suite_questions import SuiteQuestions as sq

class SuiteQuestions(QuestionContainer, Enum):

# --------------------------------------------------------------------------------------------------
# Shared groups of questions across suites
# --------------------------------------------------------------------------------------------------

all_suites = QuestionList(
list_name="all_suites",
questions=[
qd.experiment_id(),
qd.experiment_root()
]
)

# --------------------------------------------------------------------------------------------------

common = QuestionList(
list_name="common",
questions=[
all_suites,
qd.cycle_times(),
qd.start_cycle_point(),
qd.final_cycle_point(),
qd.model_components(),
qd.runahead_limit()
]
)

# --------------------------------------------------------------------------------------------------

marine = QuestionList(
list_name="marine",
questions=[
common,
qd.marine_models()
]
)
```


```python
class SuiteConfig(QuestionContainer, Enum):

_3dvar_base = QuestionList(
list_name="3dvar",
questions=[
sq.marine
]
)

# --------------------------------------------------------------------------------------------------

_3dvar_tier1 = QuestionList(
list_name="3dvar",
questions=[
_3dvar_base,
qd.start_cycle_point("2021-07-01T12:00:00Z"),
qd.final_cycle_point("2021-07-01T12:00:00Z"),
qd.jedi_build_method("use_existing"),
qd.model_components(['geos_marine']),
],
geos_marine=[
qd.cycle_times(['T12']),
qd.marine_models(['mom6']),
qd.window_length("P1D"),
qd.horizontal_resolution("72x36"),
qd.vertical_resolution("50"),
qd.total_processors(6),
qd.obs_experiment("s2s_v1"),
qd.observations([
"adt_cryosat2n",
"adt_jason3",
"adt_saral",
"adt_sentinel3a",
"adt_sentinel3b",
"insitu_profile_argo",
"sst_ostia",
"sss_smos",
"sss_smapv5",
"sst_abi_g16_l3c",
"sst_gmi_l3u",
"sst_viirs_n20_l3u",
"temp_profile_xbt"
]),
qd.obs_provider(['odas', 'gdas_marine']),
qd.background_time_offset("PT18H"),
qd.clean_patterns(['*.nc4', '*.txt']),
]
)
from swell.suites.base.all_suites import suite_configs
from swell.suites.base.suite_questions import marine

_3dvar_base = QuestionList(
list_name="3dvar",
questions=[
marine
]
)

suite_configs.register('3dvar', '3dvar_base', _3dvar_base)

# --------------------------------------------------------------------------------------------------

_3dvar_tier1 = QuestionList(
list_name="3dvar",
questions=[
_3dvar_base,
qd.start_cycle_point("2021-07-01T12:00:00Z"),
qd.final_cycle_point("2021-07-01T12:00:00Z"),
qd.jedi_build_method("use_existing"),
qd.model_components(['geos_marine']),
],
geos_marine=[
qd.cycle_times(['T12']),
qd.marine_models(['mom6']),
qd.window_length("P1D"),
qd.horizontal_resolution("72x36"),
qd.vertical_resolution("50"),
qd.total_processors(6),
qd.obs_experiment("s2s_v1"),
qd.observations([
"adt_cryosat2n",
"adt_jason3",
"adt_saral",
"adt_sentinel3a",
"adt_sentinel3b",
"insitu_profile_argo",
"sst_ostia",
"sss_smos",
"sss_smapv5",
"sst_abi_g16_l3c",
"sst_gmi_l3u",
"sst_viirs_n20_l3u",
"temp_profile_xbt"
]),
qd.obs_provider(['odas', 'gdas_marine']),
qd.background_time_offset("PT18H"),
qd.clean_patterns(['*.nc4', '*.txt']),
]
)

suite_configs.register('3dvar', '3dvar_tier1', _3dvar_tier1)
```
The class `SuiteQuestions` contains lists of questions which are common to many suites. This avoids the need for redundantly setting the same questions for every suite.

`_3dvar_base` is responsible for establishing the baseline for questions used by the suite. The 'base' list should be used to associate all questions used by the suite. This list will be populated with the questions that match the defaults in `QuestionDefaults` (`src/swell/utilities/question_defaults.py`). However, in many cases, those defaults will not be ideal defaults for the individual suite. Thus, `_3dvar_tier1` sets different default values which override the question defaults. If desired, other configurations can then inherit question defaults from `_3dvar_tier1`, and set their own defaults on top of the existing ones.
`_3dvar_base` is responsible for establishing the baseline for questions used by the suite. The 'base' list should be used to associate all questions used by the suite. This list will be populated with the questions that match the defaults in `question_defaults.py` (`src/swell/configuration/question_defaults.py`). However, in many cases, those defaults will not be ideal defaults for the individual suite. Thus, `_3dvar_tier1` sets different default values which override the question defaults. If desired, other configurations can then inherit question defaults from `_3dvar_tier1`, and set their own defaults on top of the existing ones.
Loading
Loading