MCPcopy
hub / github.com/pydata/xarray / decode

Method decode

xarray/coding/variables.py:599–608  ·  view source on GitHub ↗
(self, variable: Variable, name: T_Name = None)

Source from the content-addressed store, hash-verified

597 return variable
598
599 def decode(self, variable: Variable, name: T_Name = None) -> Variable:
600 if variable.attrs.get("dtype", False) == "bool":
601 dims, data, attrs, encoding = unpack_for_decoding(variable)
602 # overwrite (!) dtype in encoding, and remove from attrs
603 # needed for correct subsequent encoding
604 encoding["dtype"] = attrs.pop("dtype")
605 data = BoolTypeArray(data)
606 return Variable(dims, data, attrs, encoding, fastpath=True)
607 else:
608 return variable
609
610
611class EndianCoder(VariableCoder):

Callers

nothing calls this directly

Calls 4

unpack_for_decodingFunction · 0.90
VariableClass · 0.90
BoolTypeArrayClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected