xbitinfo icon indicating copy to clipboard operation
xbitinfo copied to clipboard

`xb.get_bitinformation(implementation="julia/python")` yields different results

Open aaronspring opened this issue 3 years ago • 2 comments

  • xbitinfo version: main
  • Python version: binder
  • Operating System: binder

Description

  • @observingClouds shouldnt these yield same results?
  • I am lacking a test in #126 in https://github.com/observingClouds/xbitinfo/blob/main/tests/test_get_bitinformation.py where the numerical values of both implementations are compared and are equal
  • makes https://xbitinfo--153.org.readthedocs.build/en/153/quick-start.html fail

What I Did

ds = xr.tutorial.load_dataset("eraint_uvz")
xb.get_bitinformation(ds, dim="longitude", implementation="python")
xb.get_bitinformation(ds, dim="longitude", implementation="julia")

aaronspring avatar Oct 23 '22 19:10 aaronspring

also weird

ds = xr.tutorial.load_dataset("air_temperature")
xb.get_bitinformation(ds, dim="lon").dims # Frozen({'bit32': 32})
xb.get_bitinformation(ds, dim="lon", implementation="python").dims # Frozen({'bit64': 64})

aaronspring avatar Oct 23 '22 19:10 aaronspring

Thanks for pointing this out. Currently, since set_zero_insignificant is not implemented for the python version, the following should be true:

ds = xr.tutorial.load_dataset("eraint_uvz")
xb.get_bitinformation(ds, dim="longitude", implementation="python", set_zero_insignificant=False)
xb.get_bitinformation(ds, dim="longitude", implementation="julia", set_zero_insignificant=False, masked_value=None)

However, this also fails currently. Still very much work-in-progress.

EDIT: masked_value needs to be set to None, because masked_value is not yet implemented in the python version.

observingClouds avatar Oct 23 '22 20:10 observingClouds