Encoding lost upon concatenation · Issue #1297 · pydata/xarray (original) (raw)

@gerritholl

When using xarray.concat, attributes are retained, but encoding information is not. I believe encoding information should be retained, at least optionally.

In [64]: da = xarray.DataArray([1, 2, 3, 2, 1])

In [65]: da.attrs.update(foo="bar")

In [66]: da.encoding.update(complevel=5)

In [67]: da2 = xarray.concat((da, da), dim="new")

In [68]: print(da2.attrs)
OrderedDict([('foo', 'bar')])

In [69]: print(da2.encoding)
{}