Skip to content

Commit 6acc1de

Browse files
Merge pull request #70 from ESMValGroup/cli_update
Add changes due to new CLI
2 parents 26d4e66 + e17b11c commit 6acc1de

File tree

4 files changed

+144
-134
lines changed

4 files changed

+144
-134
lines changed

_episodes/02-installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,12 @@ to display the command line help.
244244
> >
245245
> > In my case when I run
246246
> > ~~~
247-
> > esmvaltool --version
247+
> > esmvaltool version
248248
> > ~~~
249249
> > {: .bash}
250250
> > I get that my installed ESMValTool version is
251251
> > ~~~
252-
> > 2.0.0b9
252+
> > ESMValCore: 2.0.0
253253
> > ~~~
254254
> > {: .output}
255255
> {: .solution}

_episodes/03-configuration.md

Lines changed: 117 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,19 @@ keypoints:
2222
The ``config-user.yml`` configuration file contains all the global level
2323
information needed by ESMValTool to run. This is an [YAML
2424
file](https://yaml.org/spec/1.2/spec.html). An example configuration file can be
25-
found in the root directory of the ESMValTool repository:
26-
[config-user-example.yml](https://github.com/ESMValGroup/ESMValTool/blob/master/config-user-example.yml).
25+
found in the ESMValCore repository:
26+
[config-user-example.yml](https://github.com/ESMValGroup/ESMValCore/blob/master/esmvalcore/config-user.yml).
2727

28-
First, we make a working directory ``esmvaltool_tutorial``.
29-
In a new terminal, run:
28+
You can generate the default configuration file by running:
3029

3130
~~~bash
32-
mkdir esmvaltool_tutorial
33-
cd esmvaltool_tutorial
31+
esmvaltool config get_config_user
3432
~~~
3533

36-
Now, we download the configuration file to our working directory. To do that,
37-
click on [this
38-
link](https://raw.githubusercontent.com/ESMValGroup/ESMValTool/master/config-user-example.yml)
39-
to see a raw version of the file, right-click and press ``save as``, then you
40-
can rename it to ``config-user.yml``and save it into the working directory
41-
``esmvaltool_tutorial``.
34+
It will save the file to: ``{HOME}/.esmvaltool/config-user.yml``.
4235

4336
Now, let's change our working directory in a terminal window to
44-
``esmvaltool_tutorial``. Then, we run a text editor called Nano to have a look
37+
``{HOME}/.esmvaltool``. Then, we run a text editor called Nano to have a look
4538
inside the configuration file:
4639

4740
~~~bash
@@ -50,12 +43,12 @@ inside the configuration file:
5043

5144
This file contains the information for:
5245

53-
- Rootpath to input data
54-
- Directory structure for the data from different projects
55-
- Number of tasks that can be run in parallel
46+
- Output settings
5647
- Destination directory
5748
- Auxiliary data directory
58-
- Output settings
49+
- Number of tasks that can be run in parallel
50+
- Rootpath to input data
51+
- Directory structure for the data from different projects
5952

6053
> ## Text editor side note
6154
>
@@ -67,6 +60,108 @@ This file contains the information for:
6760
> and then <kbd>ctrl</kbd> + <kbd>X</kbd> to exit ``nano``.
6861
{: .callout}
6962

63+
## Output settings
64+
65+
These settings are used to inform ESMValTool about your preference about
66+
specific actions. You can turn on or off the setting by ``true`` or ``false``
67+
values. Most of these settings are fairly self-explanatory, ie:
68+
69+
```yaml
70+
# Diagnostics create plots? [true]/false
71+
write_plots: true
72+
# Diagnositcs write NetCDF files? [true]/false
73+
write_netcdf: true
74+
# Set the console log level debug, [info], warning, error
75+
log_level: info
76+
# Exit on warning (only for NCL diagnostic scripts)? true/[false]
77+
exit_on_warning: false
78+
# Plot file format? [png]/pdf/ps/eps/epsi
79+
output_file_type: png
80+
81+
...
82+
83+
# Use netCDF compression true/[false]
84+
compress_netcdf: false
85+
# Save intermediary cubes in the preprocessor true/[false]
86+
save_intermediary_cubes: false
87+
# Remove the preproc dir if all fine
88+
remove_preproc_dir: true
89+
90+
...
91+
92+
# Path to custom config-developer file, to customise project configurations.
93+
# See config-developer.yml for an example. Set to [null] to use the default
94+
config_developer_file: null
95+
# Get profiling information for diagnostics
96+
# Only available for Python diagnostics
97+
profile_diagnostic: false
98+
```
99+
100+
## Destination directory
101+
102+
The destination directory is the rootpath where ESMValTool will store its output folders containing
103+
i.e. figures, data, logs, etc. With every run, ESMValTool automatically generates
104+
a new output folder determined by recipe name, and date and time using
105+
the format: YYYYMMDD_HHMMSS.
106+
This folder contains four further subfolders: ``plots``, ``preproc``, ``run``, ``work``.
107+
108+
Let's name our destination directory ``esmvaltool_output`` in the working directory:
109+
110+
```yaml
111+
output_dir: ./esmvaltool_output
112+
```
113+
114+
> ## Content of subfolders
115+
>
116+
> - ``plots``: the location for all plots, split by individual diagnostics and fields.
117+
> - ``preproc``: this folder contains all the preprocessed data and metadata.yml
118+
interface files. Note that by default this directory will be deleted after
119+
each run because most users will only need the results from the diagnostic scripts.
120+
> - ``run``: this folder includes all log files, a copy of the recipe,
121+
a summary of the resource usage, and the settings.yml interface files,
122+
resource_usage.txt and temporary files created by the diagnostic scripts.
123+
> - ``work``: this folder is a place for any diagnostic script results that
124+
are not plots, e.g. files in NetCDF format (depends on the diagnostic script).
125+
>
126+
> We explain more about output in the next
127+
[lesson]({{ page.root }}{% link _episodes/04-recipe.md %})
128+
{: .callout}
129+
130+
## Auxiliary data directory
131+
132+
The ``auxiliary_data_dir`` setting is the path where any required additional
133+
auxiliary data files are stored. This location allows us to tell the diagnostic
134+
script where to find the files if they can not be downloaded at runtime. This
135+
option should not be used for model or observational datasets, but for data
136+
files (e.g. shape files) used in plotting such as coastline descriptions and so
137+
on.
138+
139+
```yaml
140+
auxiliary_data_dir: ~/auxiliary_data
141+
```
142+
143+
## Number of parallel tasks
144+
145+
This option enables you to perform parallel processing.
146+
You can choose the number of tasks in parallel as
147+
1/2/3/4/... or you can set it to ``null``. That tells
148+
ESMValTool to use the maximum number of available CPUs:
149+
150+
```yaml
151+
152+
max_parallel_tasks: null
153+
```
154+
155+
> ## Set the number of tasks
156+
>
157+
> If you run out of memory, try setting ``max_parallel_tasks`` to 1.
158+
Then, check the amount of memory you need for that by inspecting
159+
the file ``run/resource_usage.txt`` in the output directory.
160+
Using the number there you can increase the number of parallel tasks
161+
again to a reasonable number for the amount of memory available in your system.
162+
{: .callout}
163+
164+
70165
## Rootpath to input data
71166
72167
ESMValTool uses several categories (in ESMValTool, this is referred to as projects)
@@ -80,17 +175,13 @@ For each category, you can define either one path or several paths as a list.
80175
81176
```yaml
82177
rootpath:
83-
CMIP3: [~/cmip3_inputpath1, ~/cmip3_inputpath2]
84178
CMIP5: [~/cmip5_inputpath1, ~/cmip5_inputpath2]
85-
CMIP6: [~/cmip6_inputpath1, ~/cmip6_inputpath2]
86179
OBS: ~/obs_inputpath
87-
OBS6: ~/obs6_inputpath
88-
obs4mips: ~/obs4mips_inputpath
89-
ana4mips: ~/ana4mips_inputpath
90-
native6: ~/native6_inputpath
91180
RAWOBS: ~/rawobs_inputpath
92181
default: ~/default_inputpath
182+
CORDEX: ~/default_inputpath
93183
```
184+
Site-specific entries for Jasmin, DKRZ and ETHZ are listed at the end of the example configuration file.
94185
95186
In this lesson, we will work with data from
96187
[CMIP5](https://esgf-node.llnl.gov/projects/cmip5/).
@@ -131,107 +222,12 @@ drs:
131222
> [documentation](https://docs.esmvaltool.org/projects/esmvalcore/en/latest/quickstart/find_data.html#cmor-drs).
132223
{: .callout}
133224
134-
## Number of parallel tasks
135-
136-
This option enables you to perform parallel processing.
137-
You can choose the number of tasks in parallel as
138-
1/2/3/4/... or you can set it to ``null``. That tells
139-
ESMValTool to use the maximum number of available CPUs:
140-
141-
```yaml
142-
143-
max_parallel_tasks: null
144-
```
145-
146-
> ## Set the number of tasks
147-
>
148-
> If you run out of memory, try setting ``max_parallel_tasks`` to 1.
149-
Then, check the amount of memory you need for that by inspecting
150-
the file ``run/resource_usage.txt`` in the output directory.
151-
Using the number there you can increase the number of parallel tasks
152-
again to a reasonable number for the amount of memory available in your system.
153-
{: .callout}
154-
155-
## Destination directory
156-
157-
The destination directory is the rootpath where ESMValTool will store its output,
158-
i.e. figures, data, logs, etc. With every run, ESMValTool automatically generates
159-
a new output folder determined by recipe name, and date and time using
160-
the format: YYYYMMDD_HHMMSS.
161-
This folder contains four further subfolders: ``plots``, ``preproc``, ``run``, ``work``.
162-
163-
Let's name our destination directory ``esmvaltool_output`` in the working directory:
164-
165-
```yaml
166-
output_dir: ./esmvaltool_output
167-
```
168-
169-
> ## Content of subfolders
170-
>
171-
> - ``plots``: the location for all plots, split by individual diagnostics and fields.
172-
> - ``preproc``: this folder contains all the preprocessed data and metadata.yml
173-
interface files. Note that by default this directory will be deleted after
174-
each run because most users will only need the results from the diagnostic scripts.
175-
> - ``run``: this folder includes all log files, a copy of the recipe,
176-
a summary of the resource usage, and the settings.yml interface files,
177-
resource_usage.txt and temporary files created by the diagnostic scripts.
178-
> - ``work``: this folder is a place for any diagnostic script results that
179-
are not plots, e.g. files in NetCDF format (depends on the diagnostic script).
180-
>
181-
> We explain more about output in the next
182-
[lesson]({{ page.root }}{% link _episodes/04-recipe.md %})
183-
{: .callout}
184-
185-
## Auxiliary data directory
186-
187-
The ``auxiliary_data_dir`` setting is the path where any required additional
188-
auxiliary data files are stored. This location allows us to tell the diagnostic
189-
script where to find the files if they can not be downloaded at runtime. This
190-
option should not be used for model or observational datasets, but for data
191-
files (e.g. shape files) used in plotting such as coastline descriptions and so
192-
on.
193-
194-
```yaml
195-
auxiliary_data_dir: ~/auxiliary_data
196-
```
197-
198-
## Output settings
199-
200-
These settings are used to inform ESMValTool about your preference about
201-
specific actions. You can turn on or off the setting by ``true`` or ``false``
202-
values. Most of these settings are fairly self-explanatory, ie:
203-
204-
```yaml
205-
# Diagnostics create plots? [true]/false
206-
write_plots: true
207-
# Diagnositcs write NetCDF files? [true]/false
208-
write_netcdf: true
209-
# Set the console log level debug, [info], warning, error
210-
log_level: info
211-
# Exit on warning (only for NCL diagnostic scripts)? true/[false]
212-
exit_on_warning: false
213-
# Plot file format? [png]/pdf/ps/eps/epsi
214-
output_file_type: png
215-
# Use netCDF compression true/[false]
216-
compress_netcdf: false
217-
# Save intermediary cubes in the preprocessor true/[false]
218-
save_intermediary_cubes: false
219-
# Remove the preproc dir if all fine
220-
remove_preproc_dir: true
221-
# Path to custom config-developer file, to customise project configurations.
222-
# See config-developer.yml for an example. Set to [null] to use the default
223-
# config_developer_file: null
224-
# Get profiling information for diagnostics
225-
# Only available for Python diagnostics
226-
profile_diagnostic: false
227-
```
228-
229225
> ## Make your own configuration file
230226
>
231227
> It is possible to have several configuration files with different purposes,
232-
> for example: config-user_formalised_runs.yml, config-user_debugging.yml {:
233-
> .callout}
234-
>
228+
> for example: config-user_formalised_runs.yml, config-user_debugging.yml
229+
{: .callout}
230+
235231
> ## Saving preprocessed data
236232
>
237233
> In the configuration file, which settings are useful to make sure preprocessed

_episodes/04-recipe.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,14 @@ environment, (see episode #3 LINK), ESMValTool is invoked using a simple
7676
command:
7777

7878
~~~
79-
esmvaltool -c configuration recipe
79+
esmvaltool run recipe
80+
~~~
81+
{: .source}
82+
83+
If the configuration file is not in the default {HOME}\.esmvaltool\ path you can pass its path explicitly:
84+
85+
~~~
86+
esmvaltool run --config_file configuration recipe
8087
~~~
8188
{: .source}
8289

@@ -235,7 +242,7 @@ Please note the following sections:
235242
>
236243
> Use the command:
237244
> ~~~bash
238-
> esmvaltool -c ./path_to_file/user-config.yml ./path_to_file/recipe_example.yml
245+
> esmvaltool run --config_file ./path_to_file/user-config.yml ./path_to_file/recipe_example.yml
239246
> ~~~
240247
>
241248
> Follow the terminal guiding you through the subprocesses that are running. Can

_episodes/06-debugging.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ directory ``esmvaltool_tutorial`` that was created during the
2727
[Configuration]({{ page.root }}{% link _episodes/03-configuration.md %}).
2828

2929
In a new terminal, go to our working directory ``esmvaltool_tutorial`` where
30-
both files ``user-config.yml`` and ``recipe_example.yml`` are located and run
30+
the file ``recipe_example.yml`` is located and run
3131
the recipe:
3232

3333
~~~bash
3434
cd esmvaltool_tutorial
35-
esmvaltool -c user-config.yml recipe_example.yml
35+
esmvaltool run recipe_example.yml
3636
~~~
3737

3838
~~~
@@ -202,7 +202,7 @@ Also, we change the ``projects`` value ``ukesm`` to ``tutorial``:
202202
203203
Then, we save the file and run the recipe:
204204
~~~bash
205-
esmvaltool -c user-config.yml recipe_example.yml
205+
esmvaltool run recipe_example.yml
206206
~~~
207207
208208
~~~
@@ -216,10 +216,17 @@ attach the run/recipe_*.yml and run/main_log_debug.txt files from the output dir
216216
The values for the keys ``author``, ``maintainer``, ``projects`` and
217217
``references`` in the recipe should be known by ESMValTool. A list of ESMValTool
218218
author, maintainer, references, and projects can be found in the
219-
``config-references.yml`` that is located in the folder ``references`` in the
220-
ESMValTool installation directory ``path_to_esmvaltool``. To find
221-
``path_to_esmvaltool`` on your system, see [Installation]({{ page.root }}{% link
222-
_episodes/02-installation.md %}).
219+
``config-references.yml``. You could download this file by typing:
220+
221+
~~~bash
222+
esmvaltool config get_config_reference
223+
~~~
224+
225+
It will be saved to: ``{HOME}/.esmvaltool/config-references.yml``. If you modify this file, please add the directory in the ``config-user.yml``:
226+
227+
```yaml
228+
config_developer_file: {HOME}/.esmvaltool/config_reference.yml
229+
```
223230
224231
> ## ESMValTool can’t locate the data
225232
>
@@ -282,7 +289,7 @@ let's see if we can change the script path as:
282289
```
283290
284291
~~~bash
285-
esmvaltool -c user-config.yml recipe_example.yml
292+
esmvaltool run recipe_example.yml
286293
~~~
287294
288295
~~~
@@ -304,7 +311,7 @@ recipe:
304311
```
305312
306313
~~~bash
307-
esmvaltool -c user-config.yml recipe_example.yml
314+
esmvaltool run recipe_example.yml
308315
~~~
309316
310317
> ## Available recipe and diagnostic scripts

0 commit comments

Comments
 (0)