Skip to content

Commit

Permalink
fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
observingClouds authored Aug 4, 2024
1 parent 4116820 commit 2780c27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_get_bitinformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,15 @@ def test_get_bitinformation_label(rasm, implementation):
@pytest.mark.parametrize("dtype", ["float64", "float32", "float16", "int16"])
def test_get_bitinformation_dtype(rasm, dtype, implementation):
"""Test xb.get_bitinformation returns correct number of bits depending on dtype."""
dtype = np.dtype(dtype)
ds = rasm.astype(dtype)
v = list(ds.data_vars)[0]
if dtype.kind == "f":
dtype_bits = np.finfo(dtype).bits
elif dtype.kind == "i" or dtype.kind == "u":
dtype_bits = np.iinfo(dtype).bits
assert (
len(xb.get_bitinformation(ds, dim="x")[v].coords["bit" + dtype]) == dtype_bits
len(xb.get_bitinformation(ds, dim="x")[v].coords["bit" + str(dtype)]) == dtype_bits
)


Expand Down

0 comments on commit 2780c27

Please sign in to comment.