Skip to content

Commit 940c775

Browse files
committed
fix typing
1 parent b5dad00 commit 940c775

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xarray/coding/variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ 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.dtype(f"float{maxsize * 8}")
248+
return np.float32 if maxsize == 4 else np.float64
249249
# Keep float32 as-is. Upcast half-precision to single-precision,
250250
# because float16 is "intended for storage but not computation"
251251
if dtype.itemsize <= 4 and np.issubdtype(dtype, np.floating):

0 commit comments

Comments
 (0)