TimeOverflowError(operation_name, type_name)
Source¶
Bases: NumdaplotError
Raised when a value does not fit the nanoseconds counting datetimes and durations.
Without it, the value would become a wrong date or duration without any notice. A DATE is stored
in days and can be outside this range, but a calculation on it cannot.
Added in version 0.1.0
Parameters:
-
operation_name(str)The operator or the function, such as
*,from_listorToDuration. -
type_name(str)
Attributes:
-
operation_nameThe operator or the function, such as
*,from_listorToDuration. -
type_nameName of the
ndp.Typemember that cannot hold the result. -
column_name(str | None)Name of the Table column holding the values, or
Nonefor values given to an Array.
Examples:
from datetime import timedelta
import numdaplot as ndp
try:
ndp.Array.from_list([timedelta(days=1)]) * 200000
except ndp.TimeOverflowError as error:
print(error)
# The operation * gives values outside the range of DURATION, about 292 years before or after zero.