diff --git a/lindi/LindiH5Store/_zarr_info_for_h5_dataset.py b/lindi/LindiH5Store/_zarr_info_for_h5_dataset.py index 9b32407..568079d 100644 --- a/lindi/LindiH5Store/_zarr_info_for_h5_dataset.py +++ b/lindi/LindiH5Store/_zarr_info_for_h5_dataset.py @@ -88,8 +88,8 @@ def _zarr_info_for_h5_dataset(h5_dataset: h5py.Dataset) -> ZarrInfoForH5Dataset: raise Exception(f'Cannot handle scalar dataset {h5_dataset.name} with dtype {dtype}') else: # not a scalar dataset - if dtype.kind in ['i', 'u', 'f']: # integer, unsigned integer, float - # This is the normal case of a chunked dataset with a numeric dtype + if dtype.kind in ['i', 'u', 'f', 'b']: # integer, unsigned integer, float, boolean + # This is the normal case of a chunked dataset with a numeric (or boolean) dtype filters = _h5_filters_to_codecs(h5_dataset) chunks = h5_dataset.chunks if chunks is None: diff --git a/tests/test_core.py b/tests/test_core.py index 40bfa5a..ca4fb86 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -39,9 +39,10 @@ def test_scalar_datasets(): def test_numpy_arrays(): - X1 = ("1", np.arange(60).reshape(3, 20), (3, 7)) - X2 = ("2", np.arange(60).reshape(3, 20), None) - for label, array, chunks in [X1, X2]: + array_1 = ("1", np.arange(60).reshape(3, 20), (3, 7)) + array_2 = ("2", np.arange(60).reshape(3, 20), None) + array_boolean = ("3", np.array([[True, False, True], [False, True, False]]), None) + for label, array, chunks in [array_1, array_2, array_boolean]: print(f"Testing numpy array {label}") with tempfile.TemporaryDirectory() as tmpdir: filename = f"{tmpdir}/test.h5"