diff options
author | Stephan Hoyer <shoyer@climate.com> | 2015-10-12 16:44:00 -0700 |
---|---|---|
committer | Stephan Hoyer <shoyer@climate.com> | 2015-10-13 20:59:49 -0700 |
commit | 33adec24a1403df5c47afe235ac1869a8f489489 (patch) | |
tree | 86d2ed7f93c128f516413fb89598c24e132465bc /numpy/lib/tests/test_regression.py | |
parent | 9cc55dc7720a949cb3e6578805fe6f70906a700e (diff) | |
download | numpy-33adec24a1403df5c47afe235ac1869a8f489489.tar.gz |
BUG: fix casting rules for generic datetime64/timedelta64 units
Fixes GH6452
There are two types of datetime64/timedelta64 objects with generic times
units:
* NaT
* unit-less timedelta64 objects
Both of these should be safely castable to any more specific dtype. However,
more specific dtypes should not be safely castable to generic units.
Otherwise, the result of `np.datetime64('NaT')` or `np.timedelta(1)` is
entirely useless, because they can't be used in any arithmetic operations or
comparisons.
This is a regression from NumPy 1.9, where these sort of operations worked
because the default casting rules with ufuncs were less strict.
Diffstat (limited to 'numpy/lib/tests/test_regression.py')
0 files changed, 0 insertions, 0 deletions