Skip to content

Commit

Permalink
ensure time index is float not int
Browse files Browse the repository at this point in the history
  • Loading branch information
OnnoEbbens committed Oct 8, 2024
1 parent a52c383 commit 3dd0bc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nlmod/dims/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ def set_ds_time_numerical(ds,
if isinstance(time[0], (str, pd.Timestamp, cftime.datetime)):
raise TypeError("'time' argument should be of a numerical type")

time = np.asarray(time)
if (time <= 0).any():
time = np.asarray(time, dtype=float)
if (time <= 0.).any():
msg = (
"timesteps smaller or equal to 0 are not allowed"
)
Expand Down

0 comments on commit 3dd0bc9

Please sign in to comment.