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/6323#issuecomment-1496912849,https://api.github.com/repos/pydata/xarray/issues/6323,1496912849,IC_kwDOAMm_X85ZORPR,1217238,2023-04-05T04:49:34Z,2023-04-05T04:49:34Z,MEMBER,"> In the hypothetical invocation `open_dataset(..., return_encoding=True)`, do you envision the returned encoding as being a separate returned object, or would it still be an attribute on the Dataset object? My expectation was that this would be a separate object, e.g., `dataset, encoding = xarray.open_dataset(..., return_encoding=True)`, where `encoding` is a dict providing the encoding on each variable, and which could be passed as the `encoding` argument into `to_netcdf()`. That said, I can see how keeping encoding as variable attributes could also be convenient. ""disable all encoding propagation by discarding encoding attributes once a Dataset has been modified"" would be an intermediate step, on the route to removing `encoding` from Xarray's data model entirely entirely. (As a side note, I would probably spell this as `open_dataset_with_encoding` rather than having a function with a variable return signature.)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1158378382 https://github.com/pydata/xarray/issues/6323#issuecomment-1492139481,https://api.github.com/repos/pydata/xarray/issues/6323,1492139481,IC_kwDOAMm_X85Y8D3Z,1197350,2023-03-31T15:31:55Z,2023-03-31T15:31:55Z,MEMBER,We should also consider a configuration option to automatically drop encoding.,"{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1158378382 https://github.com/pydata/xarray/issues/6323#issuecomment-1492098719,https://api.github.com/repos/pydata/xarray/issues/6323,1492098719,IC_kwDOAMm_X85Y756f,2443309,2023-03-31T15:14:59Z,2023-03-31T15:14:59Z,MEMBER,"This issue was discussed at this week's dev meeting. I will summarize what we discussed: 1. General agreement that propagating encoding through arbitrary operations (e.g. slice, chunk, computation) leads to inconsistent states that are hard to protect against. This often leads to problems when serializing datasets in our backends. 2. The primary benefit of keeping encoding on Xarray objects is the ability to exactly roundtrip datasets. However, this benefit is less obvious after a dataset has been modified. 3. We currently have two APIs for setting encoding (e.g. `to_netcdf(..., encoding={...})` and `ds.encoding = {...}`). We should change this by deprecating setting encoding on Xarray objects using the `.encoding` property. 4. We can move towards providing utilities that expose a dataset's source encoding (e.g. `open_dataset(..., return_encoding=True)`. Specific action items that can happen now: - [x] add `reset_encoding` to Dataset/DatAarray api (https://github.com/pydata/xarray/issues/7686) - [ ] add a DeprecationWarning to the `@property.setter` for encoding on Dataset/DatAarray/Variable - [ ] document the change in callout in the Xarray user guide. Longer term action items: - [ ] add option to backend readers to keep / discard interpreted encoding attributes - [ ] disable all encoding propagation by discarding encoding attributes once a Dataset has been modified. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1158378382 https://github.com/pydata/xarray/issues/6323#issuecomment-1485792995,https://api.github.com/repos/pydata/xarray/issues/6323,1485792995,IC_kwDOAMm_X85Yj2bj,2443309,2023-03-27T20:06:07Z,2023-03-27T20:06:24Z,MEMBER,See also https://github.com/pydata/xarray/issues/7686. The ideas presented here are also great!,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1158378382