Conversation
kmuehlbauer
left a comment
There was a problem hiding this comment.
@sfinkens It might just work for _FillValue since it has some special casing in variable preparation. Maybe this needs some adaption in the wording.
kmuehlbauer
left a comment
There was a problem hiding this comment.
@sfinkens I've turned your added paragraph into an admonition (caution). It's more visible. Also I tested this with packed data (scale_factor and add_offset attributes). It works, if the variable in question has the needed dtype in encoding.
|
I'm not too familiar with RTS, but it seems to fail with: |
Change language identifier from "caution" to "note"
|
Sorry for the delayed response, and thanks for verifying that it also works for other encoding options. I've changed the language identifier from |
|
We may leave it as note, but that looks always like normal/general recommendation. Maybe a warning is appropriate? What would a user make most out of it? |
|
I just searched for warnings in the user guide and they are used in "this works but be careful" situations. I think in that sense it is appropriate to use a warning here as well. |
Change language identifier from "note" to "warning"

Description
Following up on the discussion in #11636, add a small paragraph to the user guide explaining that you can also use variable attributes for encoding.
My use case is forcing xarray to create a variable using
netCDF4.Dataset.createVariable(..., fill_value=False). This cannot be achieved via the encoding argument, because then xarray casts the fill value to the numerical data type of the variable (which is fine I think).