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 1112365912,PR_kwDOAMm_X84xey-w,6187,to_netcdf: docstrings for compute parameter,57705593,closed,0,,,2,2022-01-24T09:14:01Z,2023-09-14T04:36:06Z,2023-09-14T04:36:06Z,CONTRIBUTOR,,0,pydata/xarray/pulls/6187,"As discussed in #6174, closing and re-opening a file between calls of to_netcdf can be avoided by using `compute=False`. In case of many write operations on the same file (e.g. for many separate groups in a netCDF4 file), this often improves the performance significantly. This PR makes note of this effect in the docstrings so that users can learn about it without diving into the source code. - Unfortunately, it doesn't close #6174, because that issue also discusses the problem of obtaining a full list of all groups contained within a netCDF4 file when *reading* from that file. - Changes to the doc strings are not mentioned in `whats-new.rst`, are they? ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6187/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1170985441,PR_kwDOAMm_X840h_Fx,6366,Don't overwrite user-defined coordinates attributes,57705593,closed,0,,,1,2022-03-16T12:55:22Z,2022-04-10T14:45:39Z,2022-04-10T14:45:38Z,CONTRIBUTOR,,0,pydata/xarray/pulls/6366,"- [x] Closes #6310 - [x] Tests added - [x] Doesn't include user visible changes or notable bug fixes for `whats-new.rst` - [x] No new functions/methods for `api.rst` As discussed in #6310, when setting ""coordinates"" as a variable attribute instead of as an encoding, the value of that variable attribute is overwritten when writing to a NetCDF file. This PR fixes it.","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6366/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1154014066,I_kwDOAMm_X85EyNty,6310,Only auxiliary coordinates are listed in nc variable attribute,57705593,closed,0,,,9,2022-02-28T12:08:33Z,2022-04-10T14:45:38Z,2022-04-10T14:45:38Z,CONTRIBUTOR,,,,"### What happened? When saving a dataset to a NetCDF file with both dimension and auxiliary coordinates, the data variables' `coordinate` attribute only lists the coordinates that are not related to any dimension (so-called ""auxiliary"" coordinates). ### What did you expect to happen? I expect xarray to adhere to the CF conventions where it says: > Every element of every feature must be unambiguously associated with its space and time coordinates and with the feature that contains it. The coordinates attribute must be attached to every data variable to indicate the spatiotemporal coordinate variables that are needed to geo-locate the data. > [from https://cfconventions.org/cf-conventions/cf-conventions.html#coordinates-metadata] See also this example: https://cfconventions.org/cf-conventions/cf-conventions.html#_single_trajectory ### Minimal Complete Verifiable Example ```Python import xarray as xr xr.Dataset({""values"": ('time', [0.0, 0.1])}, coords={ 'time': ('time', [0, 1]), 'lat': ('time', [5, 4]), 'lon': ('time', [10, 12]) }).to_netcdf(""test.nc"") ``` ```bash $ ncdump -h test.nc netcdf test { dimensions: time = 2 ; variables: double values(time) ; values:_FillValue = NaN ; values:coordinates = ""lon lat"" ; int64 time(time) ; int64 lat(time) ; int64 lon(time) ; } ``` Note that `values:coordinates` doesn't list the `time` coordinate (as in the example in the CF conventions). ### Relevant log output _No response_ ### Anything else we need to know? I don't want to offend anyone, please correct me if I read the CF conventions in the wrong way or if this is a special case, and in general, the CF conventions recommend to only include auxiliary coordinates in the `coordinates` attribute. I couldn't find any such recommendation in the conventions text, but it's a very long document. What I did find (see my second post) is that it is ""permissible, but optional"" to list non-auxiliary variables in general, and it is required for the special case of ""Discrete Sampling Geometries"". ### Environment ``` INSTALLED VERSIONS ------------------ commit: None python: 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:59:51) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 5.4.0-100-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.1 libnetcdf: 4.8.1 xarray: 0.19.0 pandas: 1.3.4 numpy: 1.21.4 scipy: 1.7.0 netCDF4: 1.5.8 pydap: None h5netcdf: None h5py: 3.4.0 Nio: None zarr: None cftime: 1.5.1.1 nc_time_axis: None PseudoNetCDF: None rasterio: 1.2.10 cfgrib: 0.9.9.0 iris: None bottleneck: 1.3.2 dask: 2021.07.1 distributed: 2021.07.1 matplotlib: 3.4.2 cartopy: 0.20.1 seaborn: None numbagg: None pint: 0.17 setuptools: 59.2.0 pip: 21.2.1 conda: None pytest: None IPython: 7.29.0 sphinx: None ```","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6310/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue