Skip to content

Commit

Permalink
fix off by one
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLaserGit committed Jan 19, 2024
1 parent 14cf818 commit 19a332e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/run_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
dt_forcings_s = (forcings_end - forcings_start).total_seconds() / (len(df['time']) - 1)
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}"
Expand Down

0 comments on commit 19a332e

Please sign in to comment.