home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1296235033

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/7238#issuecomment-1296235033 https://api.github.com/repos/pydata/xarray/issues/7238 1296235033 IC_kwDOAMm_X85NQvoZ 6628425 2022-10-30T11:56:00Z 2022-10-30T11:56:00Z MEMBER

Hmm...I was kind of hoping we could avoid something like adding a _stacklevel_increment argument, but hardcoding the stacklevel obviously doesn't work in the case that fields are converted to variables within xarray, e.g. in the case of passing coordinates to the DataArray constructor:

```python import numpy as np import xarray as xr

times = [np.datetime64("2000-01-01", "us")] da = xr.DataArray([1], dims=["time"], coords=[times]) ```

$ python test_warning.py /Users/spencer/software/xarray/xarray/core/dataarray.py:148: 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. This warning is caused by passing non-nanosecond np.datetime64 or np.timedelta64 values to the DataArray or Variable constructor; it can be silenced by converting the values to nanosecond precision ahead of time. var = as_variable(coord, name=dim)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1428748922
Powered by Datasette · Queries took 0.713ms · About: xarray-datasette