Skip to content

Commit

Permalink
Add fix for checking is_time_series() property based on data_type
Browse files Browse the repository at this point in the history
… attr (#881)
  • Loading branch information
tomvothecoder authored Oct 29, 2024
1 parent e4e7c86 commit 111d98b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import os
from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.run import runner

param = CoreParameter()

param.reference_data_path = (
"/global/cfs/cdirs/e3sm/diagnostics/observations/Atm/time-series"
)
param.test_data_path = "/global/cfs/cdirs/e3sm/chengzhu/eamxx/post/data/rgr"
param.test_name = "eamxx_decadal"
param.seasons = ["ANN"]
# param.save_netcdf = True

param.ref_timeseries_input = True
# Years to slice the ref data, base this off the years in the filenames.
param.ref_start_yr = "1996"
param.ref_end_yr = "1996"

prefix = "/global/cfs/cdirs/e3sm/www/cdat-migration-fy24/877-attr-err"
param.results_dir = os.path.join(prefix, "eamxx_decadal_1996_1024_edv2")

runner.sets_to_run = [
"lat_lon",
# "zonal_mean_xy",
# "zonal_mean_2d",
# "zonal_mean_2d_stratosphere",
# "polar",
# "cosp_histogram",
# "meridional_mean_2d",
# "annual_cycle_zonal_mean",
]

runner.run_diags([param])
4 changes: 3 additions & 1 deletion e3sm_diags/driver/utils/dataset_xr.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ def __init__(

@property
def is_time_series(self):
if self.parameter.ref_timeseries_input or self.parameter.test_timeseries_input:
if (self.data_type == "ref" and self.parameter.ref_timeseries_input) or (
self.data_type == "test" and self.parameter.test_timeseries_input
):
return True
else:
return False
Expand Down

0 comments on commit 111d98b

Please sign in to comment.