Skip to content

Commit 9a69cf4

Browse files
committed
Update task handling in test_images
1 parent 0f24ccd commit 9a69cf4

File tree

5 files changed

+74
-56
lines changed

5 files changed

+74
-56
lines changed

tests/integration/generated/test_weekly_comprehensive_v3_chrysalis.cfg

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
case = "v3.LR.historical_0051"
33
constraint = ""
44
dry_run = "False"
5-
environment_commands = ""
5+
environment_commands = "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.12.0rc2_chrysalis.sh"
66
fail_on_dependency_skip = True
77
infer_path_parameters = False
88
infer_section_parameters = False
99
input = /lcrc/group/e3sm2/ac.wlin//E3SMv3/v3.LR.historical_0051
1010
input_subdir = archive/atm/hist
1111
mapping_file = "map_ne30pg2_to_cmip6_180x360_aave.20200201.nc"
12-
output = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/unique_id/v3.LR.historical_0051"
12+
output = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/update_test_images_20251021_try2/v3.LR.historical_0051"
1313
partition = "debug"
1414
qos = "regular"
15-
www = "/lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_comprehensive_v3_www/unique_id"
15+
www = "/lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_comprehensive_v3_www/update_test_images_20251021_try2"
1616
years = "1985:1989:2",
1717

1818
[climo]
@@ -26,14 +26,14 @@ walltime = "00:30:00"
2626
vars = ""
2727

2828
[[ atm_monthly_diurnal_8xdaily_180x360_aave ]]
29-
active = True
29+
active = False
3030
frequency = "diurnal_8xdaily"
3131
input_files = "eam.h3"
3232
input_subdir = "archive/atm/hist"
3333
vars = "PRECT"
3434

3535
[[ land_monthly_climo ]]
36-
active = True
36+
active = False
3737
frequency = "monthly"
3838
input_files = "elm.h0"
3939
input_subdir = "archive/lnd/hist"
@@ -51,14 +51,14 @@ walltime = "00:30:00"
5151
years = "1985:1995:2", # Need 10 years for pcmdi_diags task
5252

5353
[[ atm_daily_180x360_aave ]]
54-
active = True
54+
active = False
5555
frequency = "daily"
5656
input_files = "eam.h1"
5757
input_subdir = "archive/atm/hist"
5858
vars = "PRECT"
5959

6060
[[ rof_monthly ]]
61-
active = True
61+
active = False
6262
extra_vars = 'areatotal2'
6363
frequency = "monthly"
6464
input_files = "mosart.h0"
@@ -68,15 +68,15 @@ walltime = "00:30:00"
6868

6969
[[ atm_monthly_glb ]]
7070
# Note global average won't work for 3D variables.
71-
active = True
71+
active = False
7272
frequency = "monthly"
7373
input_files = "eam.h0"
7474
input_subdir = "archive/atm/hist"
7575
mapping_file = "glb"
7676
years = "1985:1995:5",
7777

7878
[[ lnd_monthly_glb ]]
79-
active = True
79+
active = False
8080
frequency = "monthly"
8181
input_files = "elm.h0"
8282
input_subdir = "archive/lnd/hist"
@@ -116,11 +116,11 @@ walltime = "00:30:00"
116116
# walltime = "00:30:00"
117117

118118
[e3sm_diags]
119-
active = True
119+
active = False
120120
climo_diurnal_frequency = "diurnal_8xdaily"
121121
climo_diurnal_subsection = "atm_monthly_diurnal_8xdaily_180x360_aave"
122122
climo_subsection = "atm_monthly_180x360_aave"
123-
environment_commands = "source <INSERT PATH TO CONDA>/conda.sh; conda activate <INSERT ENV NAME>"
123+
environment_commands = "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.12.0rc2_chrysalis.sh"
124124
grid = '180x360_aave'
125125
multiprocessing = True
126126
num_workers = 8
@@ -172,16 +172,16 @@ tc_obs = "/lcrc/group/e3sm/diagnostics/observations/Atm/tc-analysis/"
172172
tag = "model_vs_model"
173173
ts_num_years_ref = 2
174174
# Reference paths
175-
reference_data_path = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/unique_id/v3.LR.historical_0051/post/atm/180x360_aave/clim"
175+
reference_data_path = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/update_test_images_20251021_try2/v3.LR.historical_0051/post/atm/180x360_aave/clim"
176176
# mvm streamflow only
177177
gauges_path = "/lcrc/group/e3sm/diagnostics/observations/Atm/time-series/GSIM/GSIM_catchment_characteristics_all_1km2.csv"
178-
reference_data_path_ts_rof = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/unique_id/v3.LR.historical_0051/post/rof/native/ts/monthly"
178+
reference_data_path_ts_rof = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/update_test_images_20251021_try2/v3.LR.historical_0051/post/rof/native/ts/monthly"
179179
# mvm diurnal_cycle only
180-
reference_data_path_climo_diurnal = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/unique_id/v3.LR.historical_0051/post/atm/180x360_aave/clim_diurnal_8xdaily"
180+
reference_data_path_climo_diurnal = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/update_test_images_20251021_try2/v3.LR.historical_0051/post/atm/180x360_aave/clim_diurnal_8xdaily"
181181
# mvm "enso_diags", "qbo", "area_mean_time_series"
182-
reference_data_path_ts = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/unique_id/v3.LR.historical_0051/post/atm/180x360_aave/ts/monthly"
182+
reference_data_path_ts = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/update_test_images_20251021_try2/v3.LR.historical_0051/post/atm/180x360_aave/ts/monthly"
183183
# mvm tropical_subseasonal only
184-
reference_data_path_ts_daily = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/unique_id/v3.LR.historical_0051/post/atm/180x360_aave/ts/daily"
184+
reference_data_path_ts_daily = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/update_test_images_20251021_try2/v3.LR.historical_0051/post/atm/180x360_aave/ts/daily"
185185

186186
[[ lnd_monthly_mvm_lnd ]]
187187
# Test model-vs-model using the same files as the reference
@@ -197,10 +197,10 @@ tc_obs = "/lcrc/group/e3sm/diagnostics/observations/Atm/tc-analysis/"
197197
tag = "model_vs_model"
198198
ts_num_years_ref = 2
199199
# Reference paths
200-
reference_data_path = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/unique_id/v3.LR.historical_0051/post/lnd/180x360_aave/clim"
200+
reference_data_path = "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/update_test_images_20251021_try2/v3.LR.historical_0051/post/lnd/180x360_aave/clim"
201201

202202
[mpas_analysis]
203-
active = True
203+
active = False
204204
anomalyRefYear = 1985
205205
climo_years = "1985-1989", "1990-1995",
206206
enso_years = "1985-1989", "1990-1995",
@@ -213,9 +213,9 @@ ts_years = "1985-1989", "1985-1995",
213213
walltime = "00:30:00"
214214

215215
[global_time_series]
216-
active = True
216+
active = False
217217
climo_years = "1985-1989", "1990-1995",
218-
environment_commands = "source <INSERT PATH TO CONDA>/conda.sh; conda activate <INSERT ENV NAME>"
218+
environment_commands = "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.12.0rc2_chrysalis.sh"
219219
experiment_name = "v3.LR.historical_0051"
220220
figstr = "v3.LR.historical_0051"
221221
#moc_file=mocTimeSeries_1985-1995.nc
@@ -299,7 +299,7 @@ years = "1985-1995",
299299

300300

301301
[ilamb]
302-
active = True
302+
active = False
303303
e3sm_to_cmip_atm_subsection = "atm_monthly_180x360_aave"
304304
e3sm_to_cmip_land_subsection = "land_monthly"
305305
ilamb_obs = "/lcrc/group/e3sm/diagnostics/ilamb_data"
@@ -314,7 +314,7 @@ years = "1985:1989:4"
314314

315315
[pcmdi_diags]
316316
active = True
317-
environment_commands_secondary = "source <INSERT PATH TO CONDA>/conda.sh; conda activate <INSERT ENV NAME>"
317+
environment_commands_secondary = "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.12.0rc2_chrysalis.sh"
318318
walltime = "2:00:00"
319319
model_name = 'e3sm.historical.v3-LR.0051'
320320
model_tableID = 'Amon'

tests/integration/generated/update_weekly_expected_files_chrysalis.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ do
3535
# Copy output so you don't have to rerun zppy to generate the output.
3636
if [[ "${test_name,,}" =~ "v2" ]]; then
3737
# We need the v2 case name
38-
cp -r /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_${test_name}_www/unique_id/v2.LR.historical_0201 /lcrc/group/e3sm/public_html/zppy_test_resources/expected_${test_name}
38+
cp -r /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_${test_name}_www/update_test_images_20251021_try2/v2.LR.historical_0201 /lcrc/group/e3sm/public_html/zppy_test_resources/expected_${test_name}
3939
else
4040
# We need the v3 case name
41-
cp -r /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_${test_name}_www/unique_id/v3.LR.historical_0051 /lcrc/group/e3sm/public_html/zppy_test_resources/expected_${test_name}
41+
cp -r /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_${test_name}_www/update_test_images_20251021_try2/v3.LR.historical_0051 /lcrc/group/e3sm/public_html/zppy_test_resources/expected_${test_name}
4242
fi
4343

4444
# test_bundles.py also needs the bash files transferred.
4545
# Note that for legacy cfgs, we're only testing test_images.py
4646
if [[ "${test_name,,}" == "bundles" ]]; then
4747
mkdir -p /lcrc/group/e3sm/public_html/zppy_test_resources/expected_bundles/bundle_files
48-
cp -r /lcrc/group/e3sm/ac.forsyth2/zppy_weekly_bundles_output/unique_id/v3.LR.historical_0051/post/scripts/bundle*.bash /lcrc/group/e3sm/public_html/zppy_test_resources/expected_bundles/bundle_files
48+
cp -r /lcrc/group/e3sm/ac.forsyth2/zppy_weekly_bundles_output/update_test_images_20251021_try2/v3.LR.historical_0051/post/scripts/bundle*.bash /lcrc/group/e3sm/public_html/zppy_test_resources/expected_bundles/bundle_files
4949
fi
5050

5151
zppy_top_level=$(pwd)

tests/integration/image_checker.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ def set_up_and_run_image_checker(
7676
print(f"{key}: {d[key]}")
7777
parameters: Parameters = Parameters(d)
7878
for task in task_list:
79-
if task == "pcmdi_diags":
80-
print(f"{task} hs no expected results yet, skipping.")
81-
continue
8279
test_results = check_images(parameters, task)
8380
test_results_dict[f"{cfg_specifier}_{task}"] = test_results
8481

tests/integration/test_images.py

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
V2_CASE_NAME = "v2.LR.historical_0201"
1212

1313

14+
def intersect_tasks(
15+
available_tasks: List[str], requested_tasks: List[str]
16+
) -> List[str]:
17+
return [task for task in requested_tasks if task in available_tasks]
18+
19+
1420
def test_images():
1521
# To test a different branch, set this to True, and manually set the expansions.
1622
TEST_DIFFERENT_EXPANSIONS = False
@@ -27,13 +33,20 @@ def test_images():
2733
expansions = get_expansions()
2834
diff_dir_suffix = ""
2935
test_results_dict: Dict[str, Results] = dict()
30-
tasks_to_run: List[str] = list(expansions["tasks_to_run"])
36+
requested_tasks: List[str] = list(expansions["tasks_to_run"])
3137
try:
3238
# TODO: these could be run in parallel, if easy to implement
3339

3440
# Weekly comprehensive tests
3541
print("Checking weekly cfg output")
3642
if "weekly_comprehensive_v2" in expansions["cfgs_to_run"]:
43+
available_tasks = [
44+
"e3sm_diags",
45+
"mpas_analysis",
46+
"global_time_series",
47+
"ilamb",
48+
]
49+
tasks_to_run = intersect_tasks(available_tasks, requested_tasks)
3750
set_up_and_run_image_checker(
3851
"comprehensive_v2",
3952
V2_CASE_NAME,
@@ -43,6 +56,15 @@ def test_images():
4356
test_results_dict,
4457
)
4558
if "weekly_comprehensive_v3" in expansions["cfgs_to_run"]:
59+
# Adds pcmdi_diags
60+
available_tasks = [
61+
"e3sm_diags",
62+
"mpas_analysis",
63+
"global_time_series",
64+
"ilamb",
65+
"pcmdi_diags",
66+
]
67+
tasks_to_run = intersect_tasks(available_tasks, requested_tasks)
4668
set_up_and_run_image_checker(
4769
"comprehensive_v3",
4870
V3_CASE_NAME,
@@ -53,17 +75,14 @@ def test_images():
5375
)
5476
if "weekly_bundles" in expansions["cfgs_to_run"]:
5577
# No mpas_analysis
56-
if "mpas_analysis" in expansions["tasks_to_run"]:
57-
tasks_to_run_modified = tasks_to_run.copy()
58-
tasks_to_run_modified.remove("mpas_analysis")
59-
else:
60-
tasks_to_run_modified = tasks_to_run
78+
available_tasks = ["e3sm_diags", "global_time_series", "ilamb"]
79+
tasks_to_run = intersect_tasks(available_tasks, requested_tasks)
6180
set_up_and_run_image_checker(
6281
"bundles",
6382
V3_CASE_NAME,
6483
expansions,
6584
diff_dir_suffix,
66-
tasks_to_run_modified,
85+
tasks_to_run,
6786
test_results_dict,
6887
)
6988

@@ -72,6 +91,13 @@ def test_images():
7291
# to check for backwards-compatiblity issues.
7392
print("Checking legacy cfg output")
7493
if "weekly_legacy_3.0.0_comprehensive_v2" in expansions["cfgs_to_run"]:
94+
available_tasks = [
95+
"e3sm_diags",
96+
"mpas_analysis",
97+
"global_time_series",
98+
"ilamb",
99+
]
100+
tasks_to_run = intersect_tasks(available_tasks, requested_tasks)
75101
set_up_and_run_image_checker(
76102
"legacy_3.0.0_comprehensive_v2",
77103
V2_CASE_NAME,
@@ -81,6 +107,13 @@ def test_images():
81107
test_results_dict,
82108
)
83109
if "weekly_legacy_3.0.0_comprehensive_v3" in expansions["cfgs_to_run"]:
110+
available_tasks = [
111+
"e3sm_diags",
112+
"mpas_analysis",
113+
"global_time_series",
114+
"ilamb",
115+
]
116+
tasks_to_run = intersect_tasks(available_tasks, requested_tasks)
84117
set_up_and_run_image_checker(
85118
"legacy_3.0.0_comprehensive_v3",
86119
V3_CASE_NAME,
@@ -91,17 +124,14 @@ def test_images():
91124
)
92125
if "weekly_legacy_3.0.0_bundles" in expansions["cfgs_to_run"]:
93126
# No mpas_analysis
94-
if "mpas_analysis" in expansions["tasks_to_run"]:
95-
tasks_to_run_modified = tasks_to_run.copy()
96-
tasks_to_run_modified.remove("mpas_analysis")
97-
else:
98-
tasks_to_run_modified = tasks_to_run
127+
available_tasks = ["e3sm_diags", "global_time_series", "ilamb"]
128+
tasks_to_run = intersect_tasks(available_tasks, requested_tasks)
99129
set_up_and_run_image_checker(
100130
"legacy_3.0.0_bundles",
101131
V3_CASE_NAME,
102132
expansions,
103133
diff_dir_suffix,
104-
tasks_to_run_modified,
134+
tasks_to_run,
105135
test_results_dict,
106136
)
107137
except Exception as e:

tests/integration/utils.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,16 @@
1212
# pytest tests/integration/test_*.py
1313

1414
TEST_SPECIFICS: Dict[str, Any] = {
15-
"diags_environment_commands": "source <INSERT PATH TO CONDA>/conda.sh; conda activate <INSERT ENV NAME>",
16-
"global_time_series_environment_commands": "source <INSERT PATH TO CONDA>/conda.sh; conda activate <INSERT ENV NAME>",
17-
"pcmdi_diags_environment_commands": "source <INSERT PATH TO CONDA>/conda.sh; conda activate <INSERT ENV NAME>",
15+
"diags_environment_commands": "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.12.0rc2_chrysalis.sh",
16+
"global_time_series_environment_commands": "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.12.0rc2_chrysalis.sh",
17+
"pcmdi_diags_environment_commands": "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.12.0rc2_chrysalis.sh",
1818
"cfgs_to_run": [
19-
"weekly_bundles",
20-
"weekly_comprehensive_v2",
2119
"weekly_comprehensive_v3",
22-
"weekly_legacy_3.0.0_bundles",
23-
"weekly_legacy_3.0.0_comprehensive_v2",
24-
"weekly_legacy_3.0.0_comprehensive_v3",
2520
],
2621
"tasks_to_run": [
27-
"e3sm_diags",
28-
"mpas_analysis",
29-
"global_time_series",
30-
"ilamb",
3122
"pcmdi_diags",
3223
],
33-
"unique_id": "unique_id",
24+
"unique_id": "update_test_images_20251021_try2",
3425
}
3526

3627
# Multi-machine testing #########################################################
@@ -47,7 +38,7 @@ def get_chyrsalis_expansions(config):
4738
"case_name_v2": "v2.LR.historical_0201",
4839
"constraint": "",
4940
"diags_walltime": "5:00:00",
50-
"environment_commands_test": "",
41+
"environment_commands_test": "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.12.0rc2_chrysalis.sh",
5142
"expected_dir": "/lcrc/group/e3sm/public_html/zppy_test_resources/",
5243
"mpas_analysis_walltime": "00:30:00",
5344
"partition_long": "compute",
@@ -330,4 +321,4 @@ def generate_cfgs(unified_testing=False, dry_run=False):
330321

331322

332323
if __name__ == "__main__":
333-
generate_cfgs(unified_testing=False, dry_run=False)
324+
generate_cfgs(unified_testing=True, dry_run=False)

0 commit comments

Comments
 (0)