issues: 520306672
This data as json
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
520306672 | MDExOlB1bGxSZXF1ZXN0MzM4OTE5MTg1 | 3502 | Harmonize `FillValue` and `missing_value` during encoding and decoding steps | 13301940 | closed | 0 | 7 | 2019-11-09T01:07:25Z | 2019-12-11T20:09:15Z | 2019-11-14T01:22:51Z | MEMBER | 0 | pydata/xarray/pulls/3502 | As pointed out in https://github.com/jbusecke/cmip6_preprocessing/issues/5, xarray appears to be very strict during the encoding and decoding steps even when there are (harmless) discrepancies between ```python In [74]: from xarray.coding import variables In [75]: import numpy as np In [76]: import xarray as xr In [77]: original = xr.Variable( ...: ("x",), ...: [0.0, -1.0, 1.0], ...: encoding={"_FillValue": np.float32(1e20), "missing_value": np.float64(1e20)}, ...: ) In [78]: coder = variables.CFMaskCoder() In [79]: encoded = coder.encode(original)ValueError Traceback (most recent call last) <ipython-input-79-9fbc3632e28b> in <module> ----> 1 encoded = coder.encode(original) /glade/work/abanihi/devel/pangeo/xarray/xarray/coding/variables.py in encode(self, variable, name) 156 raise ValueError( 157 "Variable {!r} has multiple fill values {}. " --> 158 "Cannot encode data. ".format(name, [fv, mv]) 159 ) 160 ValueError: Variable None has multiple fill values [1e+20, 1e+20]. Cannot encode data. ```
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3502/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | pull |