From 6c93c39b56fa61d9d44f073b770af4968972c5b7 Mon Sep 17 00:00:00 2001 From: tomsail Date: Mon, 6 Nov 2023 18:02:11 +0100 Subject: [PATCH] forced python int for timezone --- pyposeidon/schism.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/pyposeidon/schism.py b/pyposeidon/schism.py index 19dfd420..e8d54535 100644 --- a/pyposeidon/schism.py +++ b/pyposeidon/schism.py @@ -1513,25 +1513,14 @@ def results(self, **kwargs): # set timestamp date = header2.loc[:, ["start_year", "start_month", "start_day", "start_hour", "utc_start"]] - logger.debug(date.head()) date = date.astype(int) date.columns = ["year", "month", "day", "hour", "utc"] # rename the columns - logger.debug(date.head()) - logger.debug(date.columns) - logger.debug(date["utc"].unique()) - # set the start timestamp - logger.debug(date.year.values[0], type(date.year.values[0])) - logger.debug(date.month.values[0], type(date.month.values[0])) - logger.debug(date.day.values[0], type(date.day.values[0])) - logger.debug(date.hour.values[0], type(date.hour.values[0])) - logger.debug(date.utc.values[0], type(date.utc.values[0])) - sdate = pd.Timestamp( - year=date.year.values[0], - month=date.month.values[0], - day=date.day.values[0], - hour=date.hour.values[0], - tz=date.utc.values[0], + year=int(date.year.values[0]), + month=int(date.month.values[0]), + day=int(date.day.values[0]), + hour=int(date.hour.values[0]), + tz=int(date.tz.values[0]), ) logger.info("done with generic variables \n")