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/7782#issuecomment-1523618985,https://api.github.com/repos/pydata/xarray/issues/7782,1523618985,IC_kwDOAMm_X85a0JSp,2448579,2023-04-26T15:29:14Z,2023-04-26T15:29:14Z,MEMBER,"Thanks for the in-depth investigation! > As we can see from the above output, in netCDF4-python scaling is adapting the dtype to unsigned, not masking. This is also reflected in the docs [unidata.github.io/netcdf4-python/#Variable](https://unidata.github.io/netcdf4-python/#Variable). Do we know why this is so? > If Xarray is trying to align with netCDF4-python it should separate mask and scale as netCDF4-python is doing. It does this already by using different coders but it doesn't separate it API-wise. :+1:","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1681353195 https://github.com/pydata/xarray/issues/7782#issuecomment-1520550980,https://api.github.com/repos/pydata/xarray/issues/7782,1520550980,IC_kwDOAMm_X85aocRE,2448579,2023-04-24T17:18:37Z,2023-04-24T19:55:11Z,MEMBER,"> We would want to check the different attributes and apply the coders only as needed. The current approach seeems OK no? It seems like the bug is that `UnsignedMaskCoder`should be outside `if mask_and_scale` > We would want to check the different attributes and apply the coders only as needed. EDIT: I mean that each coder checks whether it is applicable, so we already do that","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1681353195 https://github.com/pydata/xarray/issues/7782#issuecomment-1520434316,https://api.github.com/repos/pydata/xarray/issues/7782,1520434316,IC_kwDOAMm_X85an_yM,2448579,2023-04-24T15:55:48Z,2023-04-24T15:55:48Z,MEMBER,">mask_and_scale=False will also deactivate the Unsigned decoding. Do these two have to be linked? I wonder if we can handle the filling later : https://github.com/pydata/xarray/blob/2657787f76fffe4395288702403a68212e69234b/xarray/coding/variables.py#L397-L407 It seems like this code is setting fill values to the right type for CFMaskCoder which is the next step https://github.com/pydata/xarray/blob/2657787f76fffe4395288702403a68212e69234b/xarray/conventions.py#L266-L272 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1681353195