From 1f58ebdbe1155b3df2cdff06f818501f49a18e73 Mon Sep 17 00:00:00 2001 From: Sean Bryan Date: Fri, 24 Nov 2023 12:57:34 +1100 Subject: [PATCH] Move experiment key under `fluxsite` --- benchcab/benchcab.py | 4 ++- benchcab/data/config-schema.yml | 24 ++++++++--------- benchcab/data/test/config-invalid.yml | 3 ++- benchcab/data/test/config-valid.yml | 2 -- benchcab/data/test/integration.sh | 5 ++-- benchcab/internal.py | 2 ++ docs/user_guide/config_options.md | 39 ++++++++++++++------------- 7 files changed, 42 insertions(+), 37 deletions(-) diff --git a/benchcab/benchcab.py b/benchcab/benchcab.py index 748d32e1..fab16f4c 100644 --- a/benchcab/benchcab.py +++ b/benchcab/benchcab.py @@ -122,7 +122,9 @@ def _initialise_tasks(self, config: dict) -> list[Task]: "science_configurations", internal.DEFAULT_SCIENCE_CONFIGURATIONS ), fluxsite_forcing_file_names=get_met_forcing_file_names( - config["experiment"] + config.get("fluxsite", {}).get( + "experiment", internal.FLUXSITE_DEFAULT_EXPERIMENT + ) ), ) return self.tasks diff --git a/benchcab/data/config-schema.yml b/benchcab/data/config-schema.yml index ba7b1fc9..892d3abf 100644 --- a/benchcab/data/config-schema.yml +++ b/benchcab/data/config-schema.yml @@ -6,18 +6,6 @@ modules: schema: type: "string" -experiment: - type: "string" - allowed: [ - "five-site-test", - "forty-two-site-test", - "AU-Tum", - "AU-How", - "FI-Hyy", - "US-Var", - "US-Whs" - ] - science_configurations: type: "list" schema: @@ -72,6 +60,18 @@ fluxsite: type: "dict" required: false schema: + experiment: + type: "string" + allowed: [ + "five-site-test", + "forty-two-site-test", + "AU-Tum", + "AU-How", + "FI-Hyy", + "US-Var", + "US-Whs" + ] + required: false multiprocessing: type: "boolean" required: false diff --git a/benchcab/data/test/config-invalid.yml b/benchcab/data/test/config-invalid.yml index 0e2f6e6b..7657de60 100644 --- a/benchcab/data/test/config-invalid.yml +++ b/benchcab/data/test/config-invalid.yml @@ -1,7 +1,8 @@ # A sample configuration that should fail validation. project: w97 -experiment: NON EXISTENT EXPERIMENT!!! +fluxsite: + experiment: NON EXISTENT EXPERIMENT!!! realisations: [ { diff --git a/benchcab/data/test/config-valid.yml b/benchcab/data/test/config-valid.yml index 70aafa55..e379119f 100644 --- a/benchcab/data/test/config-valid.yml +++ b/benchcab/data/test/config-valid.yml @@ -17,8 +17,6 @@ project: w97 -experiment: five-site-test - realisations: - repo: svn: diff --git a/benchcab/data/test/integration.sh b/benchcab/data/test/integration.sh index 64d2d996..3169de9c 100644 --- a/benchcab/data/test/integration.sh +++ b/benchcab/data/test/integration.sh @@ -17,8 +17,6 @@ git reset --hard 6287539e96fc8ef36dc578201fbf9847314147fb cat > config.yaml << EOL project: $PROJECT -experiment: AU-Tum - realisations: - repo: svn: @@ -27,6 +25,9 @@ realisations: git: branch: main +fluxsite: + experiment: AU-Tum + modules: [ intel-compiler/2021.1.1, netcdf/4.7.4, diff --git a/benchcab/internal.py b/benchcab/internal.py index cbfb4a6a..bf6b6799 100644 --- a/benchcab/internal.py +++ b/benchcab/internal.py @@ -223,6 +223,8 @@ ], } +FLUXSITE_DEFAULT_EXPERIMENT = "forty-two-site-test" + OPTIONAL_COMMANDS = ["fluxsite-bitwise-cmp"] diff --git a/docs/user_guide/config_options.md b/docs/user_guide/config_options.md index b199de2f..36caab3b 100644 --- a/docs/user_guide/config_options.md +++ b/docs/user_guide/config_options.md @@ -54,9 +54,25 @@ modules: [ ``` -## experiment +## fluxsite +Contains settings specific to fluxsite tests. + +This key is _optional_. **Default** settings for the fluxsite tests will be used if it is not present + +```yaml +fluxsite: + experiment: AU-How + pbs: + ncpus: 18 + mem: 30GB + walltime: 06:00:00 + storage: [scratch/a00, gdata/xy11] + multiprocess: True +``` -: **Default:** _required key, no default_. :octicons-dash-24: Type of experiment to run. Experiments are defined in the **benchcab-evaluation** workspace on [modelevaluation.org][meorg]. This key specifies the met forcing files used in the test suite. To choose from: +### [experiment](#experiment) + +: **Default:** `forty-two-site-test`, _optional key_. :octicons-dash-24: Type of experiment to run. Experiments are defined in the **benchcab-evaluation** workspace on [modelevaluation.org][meorg]. This key specifies the met forcing files used in the test suite. To choose from: : | Key value | Experiment description | |-----------|------------------------| @@ -68,25 +84,10 @@ modules: [ | `US-Var` | Run simulations at the Vaira Ranch-Ione (US) site | | `US-Whs` | Run simulations at the Walnut Gulch Lucky Hills Shrub (US) site | -```yaml - -experiment: "AU-How" - -``` - -## fluxsite -Contains settings specific to fluxsite tests. - -This key is _optional_. **Default** settings for the fluxsite tests will be used if it is not present - ```yaml fluxsite: - pbs: - ncpus: 18 - mem: 30GB - walltime: 06:00:00 - storage: [scratch/a00, gdata/xy11] - multiprocess: True + experiment: AU-How + ``` ### [pbs](#pbs)