Closed
Description
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.
import xarray as xr
import numpy as np
xr.DataArray(np.zeros(1, dtype='datetime64[us]'))
yields
xarray/core/variable.py:194: UserWarning: Converting non-nanosecond precision datetime values to nanosecond precision. This behavior can eventually be relaxed in xarray, as it is an artifact from pandas which is now beginning to support non-nanosecond precision values.
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.