forked from zarr-developers/numcodecs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: Support for NaNs in FixedScaleOffset (zarr-developers#511)
This commit addresses issue zarr-developers#511 by adding support for handling NaN inputs in the FixedScaleOffset class. The changes include: - Introduced a check to ensure that when a fill_value is provided, the input dtype must be floating-point. - fill_value must be an integer dtype - Updated type and casting validation to ensure that fill_value is correctly cast to the specified astype (eg. fill_value of 3000 cannot cast to int8) - Only support float -> int -> float transformations, as float -> float already natively support NaNs without fill_value - Added tests for fill_value options - Added fixtures for fill_value version of fixedscaleoffset References: zarr-developers#511
- Loading branch information
Showing
10 changed files
with
123 additions
and
7 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"astype": "<i2", | ||
"dtype": "<f4", | ||
"fill_value": -32768, | ||
"id": "fixedscaleoffset", | ||
"offset": 0, | ||
"scale": 100 | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"astype": "<i2", | ||
"dtype": "<f4", | ||
"fill_value": -32768, | ||
"id": "fixedscaleoffset", | ||
"offset": 10, | ||
"scale": 100 | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters