issues: 422903285
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
422903285 | MDU6SXNzdWU0MjI5MDMyODU= | 2822 | to_netcdf() fails to write if input is read from netcdf3_classic | 5186647 | closed | 0 | 6 | 2019-03-19T19:05:01Z | 2023-12-15T20:48:05Z | 2023-12-15T20:48:04Z | NONE | Code Sample```python import xarray as xr with xr.open_dataset('some_netcdf_classic_file') as ds: data = ds #do something with data Neither of these work, see exception belowdata.to_netcdf('some_new_file', 'w') data.to_netcdf('some_new_file', 'a') Writing back to the same file, or a new file with mode of NETCDF3_CLASSIC worksdata.to_netcdf('some_netcdf_classic_file', 'a') data.to_netcdf('some_new_file', 'w', 'NETCDF3_CLASSIC') ``` Problem description
Expected OutputA new file created/written in (default) NETCDF4 format with contents of the Dataset. Or at the very least provide an exception that clearly indicates the format incompatibilities.
#### Output of ``xr.show_versions()``
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.5 (default, Sep 12 2018, 05:31:16)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
python-bits: 64
OS: Linux
OS-release: 3.10.0-957.5.1.el7.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None
libhdf5: 1.8.18
libnetcdf: 4.4.1.1
xarray: 0.11.3
pandas: 0.22.0
numpy: 1.14.2
scipy: 1.0.0
netCDF4: 1.4.1
pydap: None
h5netcdf: None
h5py: 2.7.1
Nio: None
zarr: None
cftime: 1.0.1
PseudonetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
cyordereddict: None
dask: None
distributed: None
matplotlib: 1.2.0
cartopy: None
seaborn: None
setuptools: 40.4.3
pip: 18.1
conda: None
pytest: None
IPython: None
sphinx: None
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2822/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |