We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 940c775 commit 5a9aa01Copy full SHA for 5a9aa01
xarray/coding/variables.py
@@ -245,7 +245,10 @@ def _choose_float_dtype(
245
maxsize = max(maxsize, np.dtype(type(scale_factor)).itemsize)
246
if add_offset and np.issubdtype(type(add_offset), np.floating):
247
maxsize = max(maxsize, np.dtype(type(add_offset)).itemsize)
248
- return np.float32 if maxsize == 4 else np.float64
+ if maxsize == 4:
249
+ return np.float32
250
+ else:
251
+ return np.float64
252
# Keep float32 as-is. Upcast half-precision to single-precision,
253
# because float16 is "intended for storage but not computation"
254
if dtype.itemsize <= 4 and np.issubdtype(dtype, np.floating):
0 commit comments