-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unlimited_dims generates 0-length dimensions named as letters of unlimited dimension #2134
Comments
What if you do |
Yep that does it, thanks! 👍 I guess I could have read the "sequence of str" description in the docs more closely. Maybe it would make sense to accept a single string in addition to a sequence of strings? |
I still think this is a bug. I really don't know the best way to check that an object is a sequence other than a string, but it must be solved elsewhere in xarray. |
We usually write something like: if isinstance(unlimited_dims, basestring):
unlimited_dims = [unlimited_dims] (This does come up quite commonly, but the work-around is short enough that we haven't written a utility function for it.) |
fix for this in #2154. |
I'm not sure I understand how the
unlimited_dims
option toto_netcdf()
is supposed to work. Consider the following:This results in a file that looks like this:
Note the dimensions named
t
,i
,m
,e
all with zero length. Thetime
dimension (which is the only one that should exist) is properly set toUNLIMITED
but 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_dims
option (but thetime
dimension 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()
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
The text was updated successfully, but these errors were encountered: