Skip to content

Commit

Permalink
fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AFg6K7h4fhy2 committed Nov 24, 2024
1 parent a7eb80c commit 3f8a3d1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions forecasttools/idata_w_dates_to_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ def convert_timedelta_to_np(td: timedelta | np.timedelta64) -> np.timedelta64:
"""
if isinstance(td, np.timedelta64):
return td
elif isinstance(td, timedelta):
return (np.timedelta64(td.days, "D") if is_timedelta_in_days_only(td) else np.timedelta64(td).astype("timedelta64[ns]"))
else:
raise TypeError(
f"Input must be a timedelta object; got {type(td)}"
elif isinstance(td, timedelta):
return (
np.timedelta64(td.days, "D")
if is_timedelta_in_days_only(td)
else np.timedelta64(td).astype("timedelta64[ns]")
)
else:
raise TypeError(f"Input must be a timedelta object; got {type(td)}")


def generate_time_range_for_dim(
Expand Down

0 comments on commit 3f8a3d1

Please sign in to comment.