Skip to content

Commit

Permalink
WIP: plot testing for all float types
Browse files Browse the repository at this point in the history
  • Loading branch information
observingClouds committed Dec 15, 2023
1 parent 1470a76 commit 1156732
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_visualisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import xarray as xr

import xbitinfo as xb
from xbitinfo.graphics import add_bitinfo_labels
from xbitinfo.graphics import add_bitinfo_labels, plot_bitinformation


def test_add_bitinfo_labels():
Expand Down Expand Up @@ -50,3 +50,9 @@ def test_add_bitinfo_labels():
assert ax.texts[i + 5].get_text() == keepbits_text
# Cleanup the plot
plt.close()

@pytest.mark.parametrize("dtype", ["float64", "float32", "float16"])
def test_plot_bitinformation(rasm, dtype):
ds = rasm.astype(dtype)
info_per_bit = xb.get_bitinformation(ds, dim="lon")
plot_bitinformation(info_per_bit)

0 comments on commit 1156732

Please sign in to comment.