Skip to content

Commit

Permalink
fixup! Fix Zarr V3 non-finite float fill value encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Oct 6, 2024
1 parent 594b1b5 commit d96c8a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions virtualizarr/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ def __post_init__(self) -> None:

# Handle non-finite fill values
if not isinstance(self.fill_value, list):
if np.isnan(self.fill_value):
if self.fill_value is np.nan:
self.fill_value = "NaN"
elif np.isposinf(self.fill_value):
elif self.fill_value is np.inf:
self.fill_value = "Infinity"
elif np.isneginf(self.fill_value):
elif self.fill_value is -np.inf: # TODO: does this work?
self.fill_value = "-Infinity"
# TODO: Handle other data types (complex, etc.)

Expand Down

0 comments on commit d96c8a4

Please sign in to comment.