Skip to content

Commit 8031e2f

Browse files
committed
Add fix for checking is_time_series() property based on data_type attr (#881)
1 parent e268e4d commit 8031e2f

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import os
2+
from e3sm_diags.parameter.core_parameter import CoreParameter
3+
from e3sm_diags.run import runner
4+
5+
param = CoreParameter()
6+
7+
param.reference_data_path = (
8+
"/global/cfs/cdirs/e3sm/diagnostics/observations/Atm/time-series"
9+
)
10+
param.test_data_path = "/global/cfs/cdirs/e3sm/chengzhu/eamxx/post/data/rgr"
11+
param.test_name = "eamxx_decadal"
12+
param.seasons = ["ANN"]
13+
# param.save_netcdf = True
14+
15+
param.ref_timeseries_input = True
16+
# Years to slice the ref data, base this off the years in the filenames.
17+
param.ref_start_yr = "1996"
18+
param.ref_end_yr = "1996"
19+
20+
prefix = "/global/cfs/cdirs/e3sm/www/cdat-migration-fy24/877-attr-err"
21+
param.results_dir = os.path.join(prefix, "eamxx_decadal_1996_1024_edv2")
22+
23+
runner.sets_to_run = [
24+
"lat_lon",
25+
# "zonal_mean_xy",
26+
# "zonal_mean_2d",
27+
# "zonal_mean_2d_stratosphere",
28+
# "polar",
29+
# "cosp_histogram",
30+
# "meridional_mean_2d",
31+
# "annual_cycle_zonal_mean",
32+
]
33+
34+
runner.run_diags([param])

e3sm_diags/driver/utils/dataset_xr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ def __init__(
163163

164164
@property
165165
def is_time_series(self):
166-
if self.parameter.ref_timeseries_input or self.parameter.test_timeseries_input:
166+
if (self.data_type == "ref" and self.parameter.ref_timeseries_input) or (
167+
self.data_type == "test" and self.parameter.test_timeseries_input
168+
):
167169
return True
168170
else:
169171
return False

0 commit comments

Comments
 (0)