home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 323357664

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
323357664 MDU6SXNzdWUzMjMzNTc2NjQ= 2134 unlimited_dims generates 0-length dimensions named as letters of unlimited dimension 13837821 closed 0     5 2018-05-15T19:47:10Z 2018-05-18T14:48:11Z 2018-05-18T14:48:11Z CONTRIBUTOR      

I'm not sure I understand how the unlimited_dims option to to_netcdf() is supposed to work. Consider the following: python ds = xr.Dataset() ds['time'] = xr.DataArray(pd.date_range('2000-01-01', '2000-01-10'), dims='time') ds.to_netcdf('timedim.cdf', unlimited_dims='time') This results in a file that looks like this: ``` $ ncdump timedim.cdf netcdf timedim { dimensions: t = UNLIMITED ; // (0 currently) i = UNLIMITED ; // (0 currently) m = UNLIMITED ; // (0 currently) e = UNLIMITED ; // (0 currently) time = UNLIMITED ; // (10 currently) variables: int64 time(time) ; time:units = "days since 2000-01-01 00:00:00" ; time:calendar = "proleptic_gregorian" ; data:

time = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ; } `` Note the dimensions namedt,i,m,eall with zero length. Thetimedimension (which is the only one that should exist) is properly set toUNLIMITEDbut we shouldn't have the four extra dimensions. What's going on here? The same behavior occurs when setting viads.encoding['unlimited_dims'] = 'time'. Everything is as expected without theunlimited_dimsoption (but thetimedimension is notUNLIMITED`, of course).

I thought it could be related to the variable and dimension having the same name, but this also happens when they are different.

Expected Output

There shouldn't be extra 0-length dimensions

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.3.final.0 python-bits: 64 OS: Darwin OS-release: 16.7.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: None LOCALE: None.None xarray: 0.10.3 pandas: 0.22.0 numpy: 1.14.3 scipy: 1.0.0 netCDF4: 1.3.1 h5netcdf: 0.5.0 h5py: 2.7.1 Nio: None zarr: 2.2.0 bottleneck: 1.2.1 cyordereddict: None dask: 0.16.1 distributed: 1.20.2 matplotlib: 2.2.2 cartopy: 0.16.0 seaborn: None setuptools: 36.5.0.post20170921 pip: 9.0.1 conda: 4.5.3 pytest: None IPython: 6.3.1 sphinx: 1.7.1
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2134/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
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.649ms · About: xarray-datasette