-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
TST: Suppressed warnings #7099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TST: Suppressed warnings #7099
Changes from all commits
29a45ef
968507b
86b0a5e
78d7cc4
c1ddf84
308161c
9bf7d14
f078cb4
2e86117
b831444
61694be
20ea3a2
514d136
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
from . import numerictypes as _nt | ||
from .umath import maximum, minimum, absolute, not_equal, isnan, isinf | ||
from .multiarray import (array, format_longfloat, datetime_as_string, | ||
datetime_data) | ||
datetime_data, dtype) | ||
from .fromnumeric import ravel | ||
from .numeric import asarray | ||
|
||
|
@@ -734,7 +734,9 @@ class TimedeltaFormat(object): | |
def __init__(self, data): | ||
if data.dtype.kind == 'm': | ||
nat_value = array(['NaT'], dtype=data.dtype)[0] | ||
v = data[not_equal(data, nat_value)].view('i8') | ||
int_dtype = dtype(data.dtype.byteorder + 'i8') | ||
int_view = data.view(int_dtype) | ||
v = int_view[not_equal(int_view, nat_value.view(int_dtype))] | ||
if len(v) > 0: | ||
# Max str length of non-NaT elements | ||
max_str_len = max(len(str(maximum.reduce(v))), | ||
|
@@ -748,7 +750,8 @@ def __init__(self, data): | |
self._nat = "'NaT'".rjust(max_str_len) | ||
|
||
def __call__(self, x): | ||
if x + 1 == x: | ||
# TODO: After NAT == NAT deprecation should be simplified: | ||
if (x + 1).view('i8') == x.view('i8'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed to avoid warning? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NAT comparisons give a warning, and they should not while printing in any case. Actually, I am not 100% if you can simplify it currently easily, we may need |
||
return self._nat | ||
else: | ||
return self.format % x.astype('i8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the original was issuing a warning or some such?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, same, NAT Future Warning (NAT equality, could add more comments maybe).