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 922791001,MDU6SXNzdWU5MjI3OTEwMDE=,5473,Junk slice written to zarr with append_dim option,41342785,closed,0,,,2,2021-06-16T15:51:33Z,2021-10-19T18:51:18Z,2021-10-19T18:51:18Z,CONTRIBUTOR,,,," I often write to zarr using the `append_dim` option. But I find that sometimes I get a junk slice in the first index of the zarr file along the dimenstion I am appending along. This seems to be related to the way coordinates are assigned along this dimension. Here's a minimal working example: ``` import xarray as xr import numpy as np target='test_zarr.zarr' for i in range(0,10): test_slice = xr.DataArray(np.random.rand(10,20),dims=['j','k']) test_slice = test_slice.assign_coords({""time"": i*10}) #this line is necessary for this example to fail test_slice = test_slice.expand_dims('time') test_ds = test_slice.to_dataset(name='u') test_ds.to_zarr(target, append_dim='time') ``` When I open the `zarr` file: ``` test_opened = xr.open_zarr('test_zarr.zarr') test_opened.time ``` gives ``` array([140624802912264, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90]) ``` **Environment**:
Output of xr.show_versions() INSTALLED VERSIONS ------------------ commit: None python: 3.9.4 | packaged by conda-forge | (default, May 10 2021, 22:13:33) [GCC 9.3.0] python-bits: 64 OS: Linux OS-release: 3.10.0-1160.11.1.el7.centos.plus.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: None libnetcdf: None xarray: 0.18.2 pandas: 1.2.4 numpy: 1.20.3 scipy: 1.6.3 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: 2.8.1 cftime: None nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2021.06.0 distributed: 2021.06.0 matplotlib: 3.4.2 cartopy: None seaborn: None numbagg: None pint: None setuptools: 49.6.0.post20210108 pip: 21.1.2 conda: None pytest: None IPython: 7.24.1 sphinx: None
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5473/reactions"", ""total_count"": 2, ""+1"": 2, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 847376965,MDExOlB1bGxSZXF1ZXN0NjA2Mzk1NDky,5100,Tweaked Dataset.plot docs to better describe quiver,41342785,closed,0,,,1,2021-03-31T21:33:48Z,2021-05-01T17:40:06Z,2021-04-01T16:44:23Z,CONTRIBUTOR,,0,pydata/xarray/pulls/5100,"closes #5002 Based on issue #5002, I did a few tweaks to make it clearer which parts of the generated documentation apply to `quiver`, and which apply to `scatter`. I also removed references to `contourf` because that is now documented in a separate location. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5100/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 484768136,MDExOlB1bGxSZXF1ZXN0MzEwNTc2Mzc2,3259,New feature of filter_by_attrs added to whats-new.rst,41342785,closed,0,,,1,2019-08-24T02:28:05Z,2019-08-24T03:20:59Z,2019-08-24T03:20:59Z,CONTRIBUTOR,,0,pydata/xarray/pulls/3259,"I missed this in my previous pull request. @dcherian - [ ] Closes #xxxx - [ ] Tests added - [ ] Passes `black . && mypy . && flake8` - [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3259/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 484243962,MDExOlB1bGxSZXF1ZXN0MzEwMTY2MDYz,3247,Update filter_by_attrs to use 'variables' instead of 'data_vars',41342785,closed,0,,,8,2019-08-22T22:23:31Z,2019-08-23T23:27:03Z,2019-08-23T23:26:00Z,CONTRIBUTOR,,0,pydata/xarray/pulls/3247,"This will allow `filter_by_attrs` to filter coordinates as well as variables. @ocefpaf ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3247/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 484623632,MDExOlB1bGxSZXF1ZXN0MzEwNDYyOTI1,3253,Updater to testing environment name,41342785,closed,0,,,1,2019-08-23T16:55:49Z,2019-08-23T17:00:40Z,2019-08-23T17:00:40Z,CONTRIBUTOR,,0,pydata/xarray/pulls/3253,"The testing environment name has been updated to `xarray-tests` in the package and we should do this in the documentation as well. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3253/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull