home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 667763555

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
667763555 MDU6SXNzdWU2Njc3NjM1NTU= 4284 overwriting netcdf file fails at read time 11750960 closed 0     1 2020-07-29T11:17:10Z 2020-08-01T20:54:16Z 2020-08-01T20:54:16Z CONTRIBUTOR      

I generate a dataset once: ds = xr.DataArray(np.arange(10), name='x').to_dataset() ds.to_netcdf('test.nc', mode='w') Now I overwrite with a new netcdf file and load: ds = xr.DataArray(np.arange(20), name='x').to_dataset() ds.to_netcdf('test.nc', mode='w') ds_out = xr.open_dataset('test.nc') print(ds_out) outputs: <xarray.Dataset> Dimensions: (dim_0: 10) Dimensions without coordinates: dim_0 Data variables: x (dim_0) int64 ... I would have expected to get the new dataset.

If I use netcdf4, the file seems to have been properly overwritten: import netCDF4 as nc d = nc.Dataset('test.nc') d outputs: <class 'netCDF4._netCDF4.Dataset'> root group (NETCDF4 data model, file format HDF5): dimensions(sizes): dim_0(20) variables(dimensions): int64 x(dim_0) groups:

Environment:

Output of <tt>xr.show_versions()</tt> INSTALLED VERSIONS ------------------ commit: None python: 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 23:03:20) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 3.12.53-60.30-default 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.3 numpy: 1.18.1 scipy: 1.4.1 netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: None Nio: None zarr: 2.4.0 cftime: 1.1.1.2 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.13.0 distributed: 2.13.0 matplotlib: 3.3.0 cartopy: 0.17.0 seaborn: 0.10.0 numbagg: None setuptools: 46.1.3.post20200325 pip: 20.0.2 conda: None pytest: None IPython: 7.13.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4284/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
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.75ms · About: xarray-datasette