From 33bc0c64acc22b05607b574c08bf574265c82df6 Mon Sep 17 00:00:00 2001 From: Hauke Schulz <43613877+observingClouds@users.noreply.github.com> Date: Fri, 15 Dec 2023 00:03:54 -0800 Subject: [PATCH] WIP: plot testing for all float types --- tests/test_visualisation.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_visualisation.py b/tests/test_visualisation.py index 6a397b6c..f6683d0e 100644 --- a/tests/test_visualisation.py +++ b/tests/test_visualisation.py @@ -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(): @@ -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)