home / github / pull_requests

Menu
  • Search all tables
  • GraphQL API

pull_requests: 338919185

This data as json

id node_id number state locked title user body created_at updated_at closed_at merged_at merge_commit_sha assignee milestone draft head base author_association auto_merge repo url merged_by
338919185 MDExOlB1bGxSZXF1ZXN0MzM4OTE5MTg1 3502 closed 0 Harmonize `FillValue` and `missing_value` during encoding and decoding steps 13301940 <!-- Feel free to remove check-list items aren't relevant to your change --> 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 `missing_value` and `_FillValue`. For instance, when dtypes of `missing_value` and `_FillValue` are different, xarray gives up: ```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. ``` - [ ] Closes #xxxx - [x] Tests added - [x] Passes `black . && mypy . && flake8` - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API 2019-11-09T01:07:25Z 2019-12-11T20:09:15Z 2019-11-14T01:22:51Z 2019-11-14T01:22:51Z eece07932d5498a8abef6a8fbd30d00066931b18     0 43b84d4b8688f7e9e5dcf036ab4e22922b9dabe6 b74f80ca2df4920f711f9fe5762458c53ce3c2c6 MEMBER   13221727 https://github.com/pydata/xarray/pull/3502  

Links from other tables

  • 0 rows from pull_requests_id in labels_pull_requests
Powered by Datasette · Queries took 0.777ms