Skip to content

Commit b7dcb9e

Browse files
authored
Merge pull request #108 from ESMValGroup/recipe-diff
Use unified diff for recipe solutions
2 parents 99230cb + 44bad5f commit b7dcb9e

File tree

4 files changed

+232
-37
lines changed

4 files changed

+232
-37
lines changed

_episodes/04-recipe.md

Lines changed: 97 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -635,58 +635,118 @@ The snippets for the edits can be found below:
635635
636636
> ## Land surface average temperature
637637
>
638-
> ```YAML
639-
> ...
640-
> 23 - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
641-
> ...
642-
> 27 annual_statistics:
643-
> 28 operator: mean
644-
> XX area_statistics:
645-
> XX operator: mean
646-
> ...
647-
> 38 short_name: ts
648-
> 39 preprocessor: prep_timeseries
638+
> In the `diff` file below you will see the changes we have made to the file. The top 2 lines are the filenames and the lines like @@ -20,12 +20,14 @@ indicate the line numbers in the original and modified file, respectively. For more info on this format, see [here](https://en.wikipedia.org/wiki/Diff#Unified_format)
639+
>
640+
> ```diff
641+
> --- data/recipe_example.yml
642+
> +++ data/recipe_example_ts.yml
643+
> @@ -20,12 +20,14 @@
644+
> - ukesm
645+
>
646+
> datasets:
647+
> - - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005}
648+
> + - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
649+
>
650+
> preprocessors:
651+
> prep_timeseries: # For 0D fields
652+
> annual_statistics:
653+
> operator: mean
654+
> + area_statistics:
655+
> + operator: mean
656+
>
657+
> diagnostics:
658+
> # --------------------------------------------------
659+
> @@ -35,7 +37,7 @@
660+
> description: simple_time_series
661+
> variables:
662+
> timeseries_variable:
663+
> - short_name: thetaoga
664+
> + short_name: ts
665+
> preprocessor: prep_timeseries
666+
> scripts:
667+
> timeseries_diag:
649668
> ```
650669
>
651670
> Note: The x-axis in the plot now shows the years 1900 - 2000.
671+
>
672+
> Complete recipe can be downloaded as [recipe_example_ts.yml](https://github.com/ESMValGroup/ESMValTool_Tutorial/blob/master/data/recipe_example_ts.yml)
652673
{: .solution}
653674
654675
> ## Atmospheric surface average temperature
655-
> ```YAML
656-
> ...
657-
> 23 - {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
658-
> XX - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
659-
> ...
660-
> 27 annual_statistics:
661-
> 28 operator: mean
662-
> XX area_statistics:
663-
> XX operator: mean
664-
> ...
665-
> 38 short_name: tas
666-
> 39 preprocessor: prep_timeseries
676+
>
677+
> ```diff
678+
> --- data/recipe_example.yml
679+
> +++ data/recipe_example_tas.yml
680+
> @@ -20,12 +20,15 @@
681+
> - ukesm
682+
>
683+
> datasets:
684+
> - - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005}
685+
> + - {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
686+
> + - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
687+
>
688+
> preprocessors:
689+
> prep_timeseries: # For 0D fields
690+
> annual_statistics:
691+
> operator: mean
692+
> + area_statistics:
693+
> + operator: mean
694+
>
695+
> diagnostics:
696+
> # --------------------------------------------------
697+
> @@ -35,7 +38,7 @@
698+
> description: simple_time_series
699+
> variables:
700+
> timeseries_variable:
701+
> - short_name: thetaoga
702+
> + short_name: tas
703+
> preprocessor: prep_timeseries
704+
> scripts:
705+
> timeseries_diag:
667706
> ```
668707
> Note: There are now 3 plots in the work directory. One for each dataset and one for the multiple dataset overview.
708+
>
709+
> Complete recipe can be downloaded as [recipe_example_tas.yml](https://github.com/ESMValGroup/ESMValTool_Tutorial/blob/master/data/recipe_example_tas.yml)
669710
{: .solution}
670711
671712
> ## Ocean surface average temperature
672-
> ```YAML
673-
> ...
674-
> 23 - {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
675-
> XX - {dataset: HadGEM2-CC, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
676-
> XX - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
677-
> ...
678-
> 27 annual_statistics:
679-
> 28 operator: mean
680-
> XX area_statistics:
681-
> XX operator: mean
682-
> ...
683-
> 38 short_name: tos
684-
> 39 preprocessor: prep_timeseries
713+
>
714+
> ```diff
715+
> --- data/recipe_example.yml
716+
> +++ data/recipe_example_tos.yml
717+
> @@ -20,12 +20,16 @@
718+
> - ukesm
719+
>
720+
> datasets:
721+
> - - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005}
722+
> + - {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
723+
> + - {dataset: HadGEM2-CC, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
724+
> + - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
725+
>
726+
> preprocessors:
727+
> prep_timeseries: # For 0D fields
728+
> annual_statistics:
729+
> operator: mean
730+
> + area_statistics:
731+
> + operator: mean
732+
>
733+
> diagnostics:
734+
> # --------------------------------------------------
735+
> @@ -35,7 +39,7 @@
736+
> description: simple_time_series
737+
> variables:
738+
> timeseries_variable:
739+
> - short_name: thetaoga
740+
> + short_name: tos
741+
> preprocessor: prep_timeseries
742+
> scripts:
743+
> timeseries_diag:
685744
> ```
686745
> Note: The unit in the plots is now degrees celsius! There is a plot also for HadGEM2-CC.
746+
>
747+
> Complete recipe can be downloaded as [recipe_example_tos.yml](https://github.com/ESMValGroup/ESMValTool_Tutorial/blob/master/data/recipe_example_tos.yml)
687748
{: .solution}
688749
689-
690750
> ## Advanced:
691751
> If you want to add a different field, please have a look here:
692752
> http://clipc-services.ceda.ac.uk/dreq/index/CMORvar.html

data/recipe_example_tas.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ESMValTool
2+
# recipe_example.yml
3+
---
4+
documentation:
5+
description: Demonstrate basic ESMValTool example
6+
7+
authors:
8+
- demora_lee
9+
- mueller_benjamin
10+
- swaminathan_ranjini
11+
12+
maintainer:
13+
- demora_lee
14+
15+
references:
16+
- demora2018gmd
17+
# Some plots also appear in ESMValTool paper 2.
18+
19+
projects:
20+
- ukesm
21+
22+
datasets:
23+
- {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
24+
- {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
25+
26+
preprocessors:
27+
prep_timeseries: # For 0D fields
28+
annual_statistics:
29+
operator: mean
30+
area_statistics:
31+
operator: mean
32+
33+
diagnostics:
34+
# --------------------------------------------------
35+
# Time series diagnostics
36+
# --------------------------------------------------
37+
diag_timeseries_temperature:
38+
description: simple_time_series
39+
variables:
40+
timeseries_variable:
41+
short_name: tas
42+
preprocessor: prep_timeseries
43+
scripts:
44+
timeseries_diag:
45+
script: ocean/diagnostic_timeseries.py

data/recipe_example_tos.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ESMValTool
2+
# recipe_example.yml
3+
---
4+
documentation:
5+
description: Demonstrate basic ESMValTool example
6+
7+
authors:
8+
- demora_lee
9+
- mueller_benjamin
10+
- swaminathan_ranjini
11+
12+
maintainer:
13+
- demora_lee
14+
15+
references:
16+
- demora2018gmd
17+
# Some plots also appear in ESMValTool paper 2.
18+
19+
projects:
20+
- ukesm
21+
22+
datasets:
23+
- {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
24+
- {dataset: HadGEM2-CC, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
25+
- {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
26+
27+
preprocessors:
28+
prep_timeseries: # For 0D fields
29+
annual_statistics:
30+
operator: mean
31+
area_statistics:
32+
operator: mean
33+
34+
diagnostics:
35+
# --------------------------------------------------
36+
# Time series diagnostics
37+
# --------------------------------------------------
38+
diag_timeseries_temperature:
39+
description: simple_time_series
40+
variables:
41+
timeseries_variable:
42+
short_name: tos
43+
preprocessor: prep_timeseries
44+
scripts:
45+
timeseries_diag:
46+
script: ocean/diagnostic_timeseries.py

data/recipe_example_ts.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# ESMValTool
2+
# recipe_example.yml
3+
---
4+
documentation:
5+
description: Demonstrate basic ESMValTool example
6+
7+
authors:
8+
- demora_lee
9+
- mueller_benjamin
10+
- swaminathan_ranjini
11+
12+
maintainer:
13+
- demora_lee
14+
15+
references:
16+
- demora2018gmd
17+
# Some plots also appear in ESMValTool paper 2.
18+
19+
projects:
20+
- ukesm
21+
22+
datasets:
23+
- {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
24+
25+
preprocessors:
26+
prep_timeseries: # For 0D fields
27+
annual_statistics:
28+
operator: mean
29+
area_statistics:
30+
operator: mean
31+
32+
diagnostics:
33+
# --------------------------------------------------
34+
# Time series diagnostics
35+
# --------------------------------------------------
36+
diag_timeseries_temperature:
37+
description: simple_time_series
38+
variables:
39+
timeseries_variable:
40+
short_name: ts
41+
preprocessor: prep_timeseries
42+
scripts:
43+
timeseries_diag:
44+
script: ocean/diagnostic_timeseries.py

0 commit comments

Comments
 (0)