File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,10 @@ function Checker.check(
227227 sim_dates = ClimaAnalysis. dates(var)
228228 sim_indices_for_obs_dates = indexin(obs_dates, sim_dates)
229229
230+ length(sim_indices_for_obs_dates) == 1 && @warn(
231+ " There is only one date in the metadata. SequentialIndicesChecker will always return true"
232+ )
233+
230234 # Do not need to check for nothing in sim_indices_for_obs_dates because
231235 # of DimValuesChecker
232236 for i in eachindex(sim_indices_for_obs_dates)[2 : end ]
Original file line number Diff line number Diff line change @@ -187,6 +187,18 @@ import ClimaAnalysis.Template:
187187 verbose = true ,
188188 )
189189
190+ # Check warning from SequentialIndicesChecker
191+ date_var5 =
192+ TemplateVar() |>
193+ add_dim(" time" , [0.0 ], units = " s" ) |>
194+ add_attribs(start_date = " 2010-12-01T00:00:42" ) |>
195+ initialize
196+ @test_logs (:warn, r" only one date in the metadata" ) Checker. check(
197+ sequential_indices_checker,
198+ date_var5,
199+ make_metadata(date_var5),
200+ )
201+
190202 # Check sign of data
191203 sign_checker = Checker. SignChecker(0.05 )
192204 neg_var = ClimaAnalysis. remake(var, data = - var. data)
You can’t perform that action at this time.
0 commit comments