Skip to content

Commit 3c98ec7

Browse files
authored
Fix logic bug - add_offset is in encoding, not attrs. (#6851)
1 parent 88ac949 commit 3c98ec7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: xarray/coding/variables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def decode(self, variable, name=None):
269269
if "scale_factor" in attrs or "add_offset" in attrs:
270270
scale_factor = pop_to(attrs, encoding, "scale_factor", name=name)
271271
add_offset = pop_to(attrs, encoding, "add_offset", name=name)
272-
dtype = _choose_float_dtype(data.dtype, "add_offset" in attrs)
272+
dtype = _choose_float_dtype(data.dtype, "add_offset" in encoding)
273273
if np.ndim(scale_factor) > 0:
274274
scale_factor = np.asarray(scale_factor).item()
275275
if np.ndim(add_offset) > 0:

0 commit comments

Comments
 (0)