From 9e0325aede75144c13dec9723810276b9bd91ac4 Mon Sep 17 00:00:00 2001 From: astoken Date: Fri, 26 Jul 2024 16:36:40 -0500 Subject: [PATCH] bugfix: total_seconds(), instead of seconds, must be called to reliably compute seconds for timedeltas > 1 day --- getgfs/getgfs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/getgfs/getgfs.py b/getgfs/getgfs.py index 6f13ca0..e2fc471 100644 --- a/getgfs/getgfs.py +++ b/getgfs/getgfs.py @@ -245,7 +245,7 @@ def datetime_to_forecast(self, date_time): query_time = "[{t_ind}]".format( t_ind=round( - (desired_date - query_forecast).seconds + (desired_date - query_forecast).total_seconds() / (int(self.times["grads_step"][0]) * 60 * 60) ) )