Closed hakonanes closed 3 years ago
What is/was the motivation to for using float32? Most of the numpy documention seems to be using float64 which:
"...matches the precision of the builtin python float."
source: https://numpy.org/doc/stable/user/basics.types.html#basics-types
The motivation was to half memory use. The precision provided by 32-bit floating point was determined sufficient considering most detectors store patterns either with 255 (8-bit) or 65534 (16-bit) grey levels.
I would be inclined to check that (a quick google brought up mixed results, eg [1]), if it were the case I would have expected to see more people using float32 though...
[1] - https://stackoverflow.com/questions/43440821/the-real-difference-between-float32-and-float64
Most changes of NumPy array data types in kikuchipy are done by passing
numpy.dtype.float32
etc. tonumpy.ndarray.astype()
. This is not supported after NumPy v1.20 and yields this errorTypeError: expected dtype object, got 'numpy.dtype[float32]'
.The solution is to install NumPy v1.19, via either
pip install numpy==1.19
orconda install numpy==1.19
.We should consider releasing another patch forcing <1.20 in setup.py (and update the conda feedstock).