-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The new NON_NANOSECOND_WARNING is not very nice to end users #7237
Comments
Sorry for dragging this issue up again, but even with the new warning message I still have some questions. Do I have to switch to nanosecond precision times or will xarray/pandas/numpy just figure it out when I combine/compare times with different precisions? |
For the time being xarray should behave as it always has, converting any non-nanosecond precision times to nanosecond-precision before being used internally. |
And with new pandas (which I understand as being the thing/library that is changing) and new xarray, what will happen? What happens between nano and non-nano times? |
Xarray will convert any non-nanosecond precision times to nanosecond precision (or an error will be raised if this is not possible). |
For a little more discussion of this issue see #7493. As the example at the top of the issue notes, there is at least one place where non-nanosecond times can slip in (this is not intentional), but for most code pathways xarray should currently convert things automatically. |
What is your issue?
The new nanosecond warning doesn't really point anybody to where they should change their code.
Nor does it really tell them how to fix it.
yields
xarray/xarray/core/variable.py
Line 194 in f32d354
I think at the very least, the stacklevel should be specified when calling the
warn
function.It isn't really pretty, but I've been passing a parameter when I expect to pass up a warning to the end user:
eg. vispy/vispy#2405
However, others have not liked that approach.
The text was updated successfully, but these errors were encountered: