Skip to content

TypeError in _FillValue handling #582

@groutr

Description

@groutr

I am reading weather netcdf files and frequently see this error:

only 0-dimensional arrays can be converted to Python scalars
Traceback (most recent call last):
  File "<...>/kerchunk/hdf.py", line 478, in _translator
    fill = encode_fill_value(fill, dt or h5obj.dtype)
  File "<...>/kerchunk/utils.py", line 236, in encode_fill_value
    return int(v)
TypeError: only 0-dimensional arrays can be converted to Python scalars

h5py is returning a 1D array with a single integer element that is causing encode_fill_value to choke.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions