diff --git a/tests/test_bitround.py b/tests/test_bitround.py index aaa126b9..99464f38 100644 --- a/tests/test_bitround.py +++ b/tests/test_bitround.py @@ -86,26 +86,26 @@ def test_bitround_along_dim(air_temperature): ds, info_per_bit, dim="lon", inflevels=[1.0, 0.9999, 0.99, 0.975] ) - assert ds_bitrounded_along_lon.air.dtype == "float32" + assert ds_bitrounded_along_lon.air.dtype == "float64" assert ds_bitrounded_along_lon.lon.size == ds.lon.size assert ds_bitrounded_along_lon.lat.size == ds.lat.size assert ds_bitrounded_along_lon.time.size == ds.time.size assert ds.air.values.dtype == ds_bitrounded_along_lon.air.values.dtype - assert (ds - ds_bitrounded_along_lon).air.mean() < 0.001 + assert (ds - ds_bitrounded_along_lon).air.mean() < 0.01 # test for keepbits ds_bitrounded_along_lon = bi.bitround_along_dim( ds, info_per_bit, dim="lon", inflevels=None, keepbits=2 ) - assert ds_bitrounded_along_lon.air.dtype == "float32" + assert ds_bitrounded_along_lon.air.dtype == "float64" assert ds_bitrounded_along_lon.lon.size == ds.lon.size assert ds_bitrounded_along_lon.lat.size == ds.lat.size assert ds_bitrounded_along_lon.time.size == ds.time.size assert ds.air.values.dtype == ds_bitrounded_along_lon.air.values.dtype - assert (ds - ds_bitrounded_along_lon).air.mean() < 0.001 + assert (ds - ds_bitrounded_along_lon).air.mean() < 0.01 # Test error when both keepbits and inflevels are provided with pytest.raises(ValueError): diff --git a/xbitinfo/xbitinfo.py b/xbitinfo/xbitinfo.py index 4450a98f..9a98f408 100644 --- a/xbitinfo/xbitinfo.py +++ b/xbitinfo/xbitinfo.py @@ -152,13 +152,13 @@ def get_bitinformation( # noqa: C901 ------- >>> ds = xr.tutorial.load_dataset("air_temperature") >>> xb.get_bitinformation(ds, dim="lon") # doctest: +ELLIPSIS - Size: 652B - Dimensions: (bitfloat32: 32) + Size: 1kB + Dimensions: (bitfloat64: 64) Coordinates: - * bitfloat32 (bitfloat32) >> xb.get_bitinformation(ds) - Size: 1kB - Dimensions: (bitfloat32: 32, dim: 3) + Size: 2kB + Dimensions: (bitfloat64: 64, dim: 3) Coordinates: - * bitfloat32 (bitfloat32) >> xb.get_keepbits(info_per_bit, inflevel=0.99999999) Size: 28B Dimensions: (inflevel: 1) @@ -419,7 +419,7 @@ def get_keepbits(info_per_bit, inflevel=0.99): dim >> xb.get_keepbits(info_per_bit, inflevel=1.0) Size: 28B Dimensions: (inflevel: 1) @@ -427,7 +427,7 @@ def get_keepbits(info_per_bit, inflevel=0.99): dim >> info_per_bit = xb.get_bitinformation(ds) >>> xb.get_keepbits(info_per_bit) Size: 80B @@ -436,7 +436,7 @@ def get_keepbits(info_per_bit, inflevel=0.99): * dim (dim)