MCPcopy Index your code
hub / github.com/pydata/xarray / encode_nc3_attr_value

Function encode_nc3_attr_value

xarray/backends/netcdf3.py:90–99  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

88
89
90def encode_nc3_attr_value(value):
91 if isinstance(value, bytes):
92 pass
93 elif isinstance(value, str):
94 value = value.encode(STRING_ENCODING)
95 else:
96 value = coerce_nc3_dtype(np.atleast_1d(value))
97 if value.ndim > 1:
98 raise ValueError("netCDF attributes must be 1-dimensional")
99 return value
100
101
102def encode_nc3_attrs(attrs):

Callers 5

set_attributeMethod · 0.90
set_attributeMethod · 0.90
prepare_variableMethod · 0.90
set_attributeMethod · 0.90
encode_nc3_attrsFunction · 0.85

Calls 2

coerce_nc3_dtypeFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…