You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing an empty array to cftime.date2num raises the following error:
File "src/cftime/_cftime.pyx", line 218, in cftime._cftime.date2num
IndexError: index 0 is out of bounds for axis 0 with size 0
Steps to Reproduce:
cftime.date2num([], 'seconds since 2000-01-01 12:00:00')
Expected Behavior
When passing an empty array, I expected an empty array to be returned without an error, or at least for date2num to raise a descriptive error ("an empty dates array is not supported"). The former seems to be the behavior of other functions in this package like num2pydate.
The text was updated successfully, but these errors were encountered:
Environment:
cftime 1.6.2
,Python 3.10.12
Description:
Passing an empty array to cftime.date2num raises the following error:
Steps to Reproduce:
Expected Behavior
When passing an empty array, I expected an empty array to be returned without an error, or at least for date2num to raise a descriptive error ("an empty
dates
array is not supported"). The former seems to be the behavior of other functions in this package likenum2pydate
.The text was updated successfully, but these errors were encountered: