home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 461088361

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
461088361 MDU6SXNzdWU0NjEwODgzNjE= 3047 Assign attributes to DataArrays when creating dataset with PydapDataStore + subsetting 81219 closed 0     2 2019-06-26T17:14:10Z 2019-06-27T12:02:34Z 2019-06-27T12:02:33Z CONTRIBUTOR      

MCVE Code Sample

```python import xarray as xr

PyDAP access without subsetting - everything's fine

url = 'http://remotetest.unidata.ucar.edu/thredds/dodsC/testdods/coads_climatology.nc' ds = xr.open_dataset(url, engine='pydap', decode_times=False) ds.TIME.units # yields 'hour since 0000-01-01 00:00:00'

PyDAP access with subsetting - variable attributes are global...

dss = xr.open_dataset(url+'?SST[0:1:11][0:1:0][0:1:0]', engine='pydap', decode_times=False) print(dss.SST.attrs) # all good so far print(dss.TIME.attrs) # oh oh... nothing print(dss.attrs['TIME.units']) ```

Problem Description

Opening a subsetted dataset with PydapDataStore creates global attributes instead of variable attributes.

Expected Output

All the global TIME.* attributes should be attributes of the TIME DataArray.

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.15.0-50-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_CA.UTF-8 LOCALE: en_CA.UTF-8 libhdf5: 1.10.2 libnetcdf: 4.6.1 xarray: 0.12.1+60.g6fc855fb pandas: 0.23.4 numpy: 1.16.1 scipy: 1.1.0 netCDF4: 1.3.1 pydap: installed h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.0.3.4 nc_time_axis: None PseudonetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.2.1 dask: 0.19.0 distributed: 1.23.0 matplotlib: 3.0.2 cartopy: 0.17.0 seaborn: None setuptools: 41.0.0 pip: 9.0.1 conda: None pytest: 4.4.0 IPython: 7.0.1 sphinx: 1.7.1
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3047/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

  • 0 rows from issues_id in issues_labels
  • 2 rows from issue in issue_comments
Powered by Datasette · Queries took 79.226ms · About: xarray-datasette