Skip to content

Commit

Permalink
complex type check
Browse files Browse the repository at this point in the history
  • Loading branch information
magland committed Apr 4, 2024
1 parent 7dc223a commit 2e02354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lindi/conversion/attr_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def h5_to_zarr_attr(attr: Any, *, label: str = '', h5f: Union[h5py.File, None]):
return int(attr)
elif isinstance(attr, (float, np.floating)):
return encode_nan_inf_ninf(float(attr))
elif isinstance(attr, complex) or (isinstance(attr, np.ndarray) and np.issubdtype(attr.dtype, np.complexfloating)):
elif isinstance(attr, (complex, np.complexfloating)):
raise Exception(f"Complex number is not supported at {label}")
elif type(attr) in [bool, np.bool_]:
return bool(attr)
Expand Down

0 comments on commit 2e02354

Please sign in to comment.