Skip to content

Commit

Permalink
Merge pull request #154 from akleeman/fix-decode-no-tests
Browse files Browse the repository at this point in the history
Fix decode_cf_variable, without tests
  • Loading branch information
shoyer committed Jun 12, 2014
2 parents 606f388 + dffb5ec commit 3ccf1a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xray/conventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ def get_to(source, dest, k):
def decode_cf_variable(var, concat_characters=True, mask_and_scale=True,
decode_times=True):
# use _data instead of data so as not to trigger loading data
var = xray.variable.as_variable(var)
data = var._data
dimensions = var.dimensions
attributes = var.attrs.copy()
Expand All @@ -433,7 +434,7 @@ def pop_to(source, dest, k):
return v

if 'dtype' in encoding:
if var.data.dtype != encoding['dtype']:
if data.dtype != encoding['dtype']:
raise ValueError("Refused to overwrite dtype")
encoding['dtype'] = data.dtype

Expand Down

0 comments on commit 3ccf1a8

Please sign in to comment.