Skip to content

Commit

Permalink
forced python int for timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsail committed Nov 6, 2023
1 parent 03cd7de commit 6c93c39
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions pyposeidon/schism.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 6c93c39

Please sign in to comment.