Skip to content

Commit 5a9aa01

Browse files
committed
fix typing, 2nd attempt
1 parent 940c775 commit 5a9aa01

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

xarray/coding/variables.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ def _choose_float_dtype(
245245
maxsize = max(maxsize, np.dtype(type(scale_factor)).itemsize)
246246
if add_offset and np.issubdtype(type(add_offset), np.floating):
247247
maxsize = max(maxsize, np.dtype(type(add_offset)).itemsize)
248-
return np.float32 if maxsize == 4 else np.float64
248+
if maxsize == 4:
249+
return np.float32
250+
else:
251+
return np.float64
249252
# Keep float32 as-is. Upcast half-precision to single-precision,
250253
# because float16 is "intended for storage but not computation"
251254
if dtype.itemsize <= 4 and np.issubdtype(dtype, np.floating):

0 commit comments

Comments
 (0)