Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/kerchunk-fill-value' into kerchu…
Browse files Browse the repository at this point in the history
…nk-fill-value
  • Loading branch information
mpiannucci committed Oct 13, 2024
2 parents 0460626 + 69540d0 commit 4dfd104
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions virtualizarr/tests/test_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,32 @@ def test_replace_total():


def test_nan_fill_value_from_kerchunk():
i_arr = ZArray.from_kerchunk_refs({
"chunks": [2, 3],
"compressor": None,
"dtype": "<i8",
"fill_value": None,
"filters": None,
"order": "C",
"shape": [2, 3],
"zarr_format": 2,
})
i_arr = ZArray.from_kerchunk_refs(
{
"chunks": [2, 3],
"compressor": None,
"dtype": "<i8",
"fill_value": None,
"filters": None,
"order": "C",
"shape": [2, 3],
"zarr_format": 2,
}
)

assert i_arr.fill_value == 0

f_arr = ZArray.from_kerchunk_refs({
"chunks": [2, 3],
"compressor": None,
"dtype": "<f8",
"fill_value": None,
"filters": None,
"order": "C",
"shape": [2, 3],
"zarr_format": 2,
})

assert f_arr.fill_value is np.nan
f_arr = ZArray.from_kerchunk_refs(
{
"chunks": [2, 3],
"compressor": None,
"dtype": "<f8",
"fill_value": None,
"filters": None,
"order": "C",
"shape": [2, 3],
"zarr_format": 2,
}
)

assert f_arr.fill_value is np.nan

0 comments on commit 4dfd104

Please sign in to comment.