Skip to content

Commit

Permalink
Convert numpy _FillValue to native Python for serialization support.
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkinsspatial committed Oct 9, 2024
1 parent bdcbfbf commit 77f1689
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions virtualizarr/readers/hdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def _dataset_to_variable(path: str, dataset: h5py.Dataset) -> Optional[xr.Variab
fill_value = fill_value[0]
if np.isnan(fill_value):
fill_value = float("nan")
if isinstance(fill_value, np.generic):
fill_value = fill_value.item()
filters = [codec.get_config() for codec in codecs]
zarray = ZArray(
chunks=chunks,
Expand Down

0 comments on commit 77f1689

Please sign in to comment.