home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 262858955

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
262858955 MDU6SXNzdWUyNjI4NTg5NTU= 1606 BUG: _extract_nc4_variable_encoding raises when shuffle argument is set 2443309 closed 0     0 2017-10-04T16:55:59Z 2017-10-05T00:12:38Z 2017-10-05T00:12:38Z MEMBER      

I think we're missing the shuffle key from the valid encodings list below:

https://github.com/pydata/xarray/blob/24643ecee2eab04d0f84c41715d753e829f448e6/xarray/backends/netCDF4_.py#L155-L156

Python var = xr.Variable(('x',), [1, 2, 3], {}, {'chunking': (2, 1)}) encoding = _extract_nc4_variable_encoding(var, raise_on_invalid=True)

``` variable = <xarray.Variable (x: 3)> array([1, 2, 3]), raise_on_invalid = True, lsd_okay = True, backend = 'netCDF4'

def _extract_nc4_variable_encoding(variable, raise_on_invalid=False,
                                   lsd_okay=True, backend='netCDF4'):
    encoding = variable.encoding.copy()

    safe_to_drop = set(['source', 'original_shape'])
    valid_encodings = set(['zlib', 'complevel', 'fletcher32', 'contiguous',
                           'chunksizes'])
    if lsd_okay:
        valid_encodings.add('least_significant_digit')

    if (encoding.get('chunksizes') is not None and
            (encoding.get('original_shape', variable.shape) !=
                variable.shape) and not raise_on_invalid):
        del encoding['chunksizes']

    for k in safe_to_drop:
        if k in encoding:
            del encoding[k]

    if raise_on_invalid:
        invalid = [k for k in encoding if k not in valid_encodings]
        if invalid:
            raise ValueError('unexpected encoding parameters for %r backend: '
                           ' %r' % (backend, invalid))

E ValueError: unexpected encoding parameters for 'netCDF4' backend: ['shuffle']

xarray/backends/netCDF4_.py:173: ValueError ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1606/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 0 rows from issue in issue_comments
Powered by Datasette · Queries took 0.628ms · About: xarray-datasette