From 14cf8182e2cefd0e17504d9c49a2fa5c0d973ffc Mon Sep 17 00:00:00 2001 From: Jordan Laser Date: Fri, 19 Jan 2024 14:07:16 -0700 Subject: [PATCH] fix length bug --- python/run_validator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/run_validator.py b/python/run_validator.py index 6f689a2b..1cad2d68 100644 --- a/python/run_validator.py +++ b/python/run_validator.py @@ -42,7 +42,7 @@ def validate(catchments,realization_file=None): df = pd.read_csv(full_path) forcings_start = datetime.strptime(df['time'].iloc[0],'%Y-%m-%d %H:%M:%S') forcings_end = datetime.strptime(df['time'].iloc[-1],'%Y-%m-%d %H:%M:%S') - dt_forcings_s = (forcings_end - forcings_start).total_seconds() / len(df['time'][0]) + dt_forcings_s = (forcings_end - forcings_start).total_seconds() / len(df['time']) assert start_time == forcings_start, f"Realization start time {start_time} does not match forcing start time {forcings_start}" assert end_time == forcings_end, f"Realization end time {end_time} does not match forcing end time {forcings_end}" assert dt_s == dt_forcings_s, f"Realization output_interval {dt_s} does not match forcing time axis {dt_forcings_s}"