issues: 383667887
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
383667887 | MDU6SXNzdWUzODM2Njc4ODc= | 2563 | Scalars from netcdf dataset can't be written with h5netcdf | 167802 | closed | 0 | 1 | 2018-11-22T22:44:48Z | 2018-12-11T07:24:36Z | 2018-12-11T07:24:36Z | CONTRIBUTOR | Code Sample, a copy-pastable example if possibleA "Minimal, Complete and Verifiable Example" will make it much easier for maintainers to help you: http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports ```python import xarray as xr from netCDF4 import Dataset def write_netcdf(filename,zlib,least_significant_digit,data,dtype='f4',shuffle=False,contiguous=False,\ chunksizes=None,complevel=6,fletcher32=False): file = Dataset(filename,'w') file.createDimension('n', 1) foo = file.createVariable('data',\ dtype,('n'),zlib=zlib,least_significant_digit=least_significant_digit,\ shuffle=shuffle,contiguous=contiguous,complevel=complevel,fletcher32=fletcher32,chunksizes=chunksizes) foo[:] = data file.close() write_netcdf("mydatafile.nc",True,None,0.0,shuffle=True, chunksizes=(1,)) data = xr.open_dataset('mydatafile.nc') arr = data['data'] arr[0].to_netcdf('mytestfile.nc', mode='w', engine='h5netcdf') ``` Problem descriptionThe above example crashes with a TypeError since xarray 0.10.4 (works before, hence reporting the error here and not in eg. h5netcdf):
The problem here is that it is not anymore possible to squeeze an array that comes from a netcdf file that was compressed or filtered. Expected OutputThe expected output is that the creation of the trimmed netcdf file works. Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2563/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |