home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 646038170

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
646038170 MDU6SXNzdWU2NDYwMzgxNzA= 4183 Unable to decode a date in nanoseconds 397386 closed 0     6 2020-06-26T06:22:27Z 2022-04-28T10:34:20Z 2022-04-28T10:34:20Z CONTRIBUTOR      

What happened:

If the unit of a date, is a number of nanoseconds elapsed since a reference date, xarray cannot read this dataset and throws the exception KeyError: nanoseconds.

What you expected to happen:

As this unit is valid in CF model, it must be decoded. Today the units that are recognized go from day to microseconds in the module coding/time.py.

Minimal Complete Verifiable Example:

```python import numpy as np import array as xr

xr.DataArray( np.arange(0, 1e10, 1e9).astype("int64"), attrs=dict(units="nanoseconds since 1970-01-01")).to_netcdf("/tmp/test.nc") xr.open_dataset("/tmp/test.nc") ``` Environment:

Output of <tt>xr.show_versions()</tt> INSTALLED VERSIONS ------------------ commit: None python: 3.8.3 | packaged by conda-forge | (default, Jun 1 2020, 17:43:00) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 3.10.0-957.12.2.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.4 xarray: 0.15.1 pandas: 1.0.4 numpy: 1.17.5 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: 0.8.0 h5py: 2.10.0 Nio: None zarr: 2.4.0 cftime: 1.1.3 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.18.1 distributed: 2.18.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None setuptools: 47.3.1.post20200616 pip: 20.1.1 conda: 4.8.3 pytest: 5.4.3 IPython: 7.15.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4183/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 6 rows from issue in issue_comments
Powered by Datasette · Queries took 240.585ms · About: xarray-datasette