Skip to content

Commit f0037eb

Browse files
authored
Fixes for rc2 (#748)
* Updates from Unified testing * Improve error handling in templates * Add parameter inference notes
1 parent 3e0ec66 commit f0037eb

13 files changed

+51
-7
lines changed

tests/integration/generated/test_weekly_legacy_3.0.0_comprehensive_v3_chrysalis.cfg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ constraint = ""
44
dry_run = "False"
55
environment_commands = ""
66
fail_on_dependency_skip = True
7-
infer_path_parameters = False
7+
# This setting does not support backwards compatibility.
8+
# Its purpose is specifically to call attention to parameters
9+
# that zppy would otherwise just infer, perhaps making an incorrect inference.
10+
# Therefore, it is expected that a user using this setting would want to get an error
11+
# noting new parameters to add explicitly to their cfg.
12+
# infer_path_parameters = False
813
infer_section_parameters = False
914
input = /lcrc/group/e3sm2/ac.wlin//E3SMv3/v3.LR.historical_0051
1015
input_subdir = archive/atm/hist

tests/integration/template_weekly_legacy_3.0.0_comprehensive_v3.cfg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ constraint = "#expand constraint#"
44
dry_run = "#expand dry_run#"
55
environment_commands = "#expand environment_commands#"
66
fail_on_dependency_skip = True
7-
infer_path_parameters = False
7+
# This setting does not support backwards compatibility.
8+
# Its purpose is specifically to call attention to parameters
9+
# that zppy would otherwise just infer, perhaps making an incorrect inference.
10+
# Therefore, it is expected that a user using this setting would want to get an error
11+
# noting new parameters to add explicitly to their cfg.
12+
# infer_path_parameters = False
813
infer_section_parameters = False
914
input = #expand user_input_v3#/E3SMv3/#expand case_name#
1015
input_subdir = archive/atm/hist

tests/integration/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_expansions():
127127
# Set up environments
128128
# To run this test, replace conda environment with your e3sm_diags dev environment
129129
# Or the Unified environment
130-
# (The same for `global_time_series_environment_commands`)
130+
# (The same for `global_time_series_environment_commands` and `pcmdi_diags_environment_commands`)
131131
# Never set this to "" because it will print the line
132132
# `environment_commands = ""` for the [e3sm_diags] task, overriding zppy's
133133
# default of using Unified. That is, there will be no environment set.
@@ -203,7 +203,7 @@ def generate_cfgs(unified_testing=False, dry_run=False):
203203
expansions = get_expansions()
204204
if unified_testing:
205205
expansions["environment_commands"] = expansions["environment_commands_test"]
206-
# Use Unified for e3sm_diags and global_time_series unless we specify otherwise
206+
# Use Unified for e3sm_diags, global_time_series, pcmdi_diags unless we specify otherwise
207207
if expansions["diags_environment_commands"] == "":
208208
expansions["diags_environment_commands"] = expansions[
209209
"environment_commands_test"
@@ -212,6 +212,10 @@ def generate_cfgs(unified_testing=False, dry_run=False):
212212
expansions["global_time_series_environment_commands"] = expansions[
213213
"environment_commands_test"
214214
]
215+
if expansions["pcmdi_diags_environment_commands"] == "":
216+
expansions["pcmdi_diags_environment_commands"] = expansions[
217+
"environment_commands_test"
218+
]
215219
else:
216220
# The cfg doesn't need this line,
217221
# but it would be difficult to only write environment_commands in the unified_testing case.

zppy/defaults/default.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ grid = string(default="")
3131
# These two parameters enable zppy to infer path or section parameters.
3232
# This allows users to set fewer parameters, but with the risk of zppy choosing incorrect values for them.
3333
# Set to False for more transparency in path or section defintions.
34+
# Please note `infer_path_parameters = False` does NOT support backwards compatibility.
35+
# The expectation is the user will want an error message describing parameters they haven't explicitly defined.
36+
# So, as new parameters get added in successive zppy versions, they can update their cfgs accordingly.
3437
infer_path_parameters = boolean(default=True)
3538
infer_section_parameters = boolean(default=True)
3639
# The directory to be post-processed

zppy/templates/climo.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
{% include 'inclusions/slurm_header.bash' %}
33
{% include 'inclusions/boilerplate.bash' %}
4+
set -e
45
{{ environment_commands }}
6+
set +e
57

68
# Create temporary workdir
79
hash=`mktemp --dry-run -d XXXX`

zppy/templates/e3sm_diags.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
{% include 'inclusions/slurm_header.bash' %}
33
{% include 'inclusions/boilerplate.bash' %}
4+
set -e
45
{{ environment_commands }}
6+
set +e
57

68
# Make sure UVCDAT doesn't prompt us about anonymous logging
79
export UVCDAT_ANONYMOUS_LOG=False

zppy/templates/e3sm_to_cmip.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
{% include 'inclusions/slurm_header.bash' %}
33
{% include 'inclusions/boilerplate.bash' %}
4+
set -e
45
{{ environment_commands }}
6+
set +e
57

68
# Create temporary workdir
79
hash=`mktemp --dry-run -d XXXX`

zppy/templates/global_time_series.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
{% include 'inclusions/slurm_header.bash' %}
33
{% include 'inclusions/boilerplate.bash' %}
4+
set -e
45
{{ environment_commands }}
6+
set +e
57

68
# Generate global time series plots
79
################################################################################

zppy/templates/ilamb.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
{% include 'inclusions/slurm_header.bash' %}
33
{% include 'inclusions/boilerplate.bash' %}
4+
set -e
45
{{ environment_commands }}
6+
set +e
57

68
# Point to observation data
79
export ILAMB_ROOT={{ ilamb_obs }}

zppy/templates/mpas_analysis.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
{% include 'inclusions/slurm_header.bash' %}
33
{% include 'inclusions/boilerplate.bash' %}
4+
set -e
45
{{ environment_commands }}
6+
set +e
57

68
# Additional settings for MPAS-Analysis
79
export OMP_NUM_THREADS=1

0 commit comments

Comments
 (0)