html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/4046#issuecomment-625857192,https://api.github.com/repos/pydata/xarray/issues/4046,625857192,MDEyOklzc3VlQ29tbWVudDYyNTg1NzE5Mg==,1197350,2020-05-08T14:59:43Z,2020-05-08T14:59:43Z,MEMBER,"Thanks for raising this useful issue.
There are two ways to control Zarr chunks:
- Specify chunks in `encoding` (always takes precedence)
- Determine chunks based on Dask chunks
If neither of these are present, Xarray creates the zarr arrays with no chunks specified. In this case, zarr will choose the chunks automatically for you. This behavior is described in the Zarr docs:
https://zarr.readthedocs.io/en/stable/tutorial.html#chunk-size-and-shape
> If you are feeling lazy, you can let Zarr guess a chunk shape for your data by providing chunks=True, although please note that the algorithm for guessing a chunk shape is based on simple heuristics and may be far from optimal
You can override this default per variable by specifying a single global chunk in encoding:
```python
ds.foo.encoding['chunks'] = -1
```
or, at write time,
```python
ds.to_zarr('test.zarr', mode='w', encoding={'foo': {'chunks': -1}})
```
I agree that none of this is described well in the Xarray docs. A PR to improve the docs would be most welcome. 😉 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,614785886