To solve issue #49 caused by changes to the latest xarray:
In land_check function when stacking dimensions land_check doesn't create anymore a multi-index ( this potentially should also speed up calculations), coordinates are added again before concatenating results.
In both threshold() and detect() was necessary to re-assign the coordinates, reset the "stacked" array using set_xindex to be able to unstack again, for example:
dims = list(ts.cell.coords)
mhw_results = [r[0].assign_coords({d: r[0][d][0].values for d in dims}) for r in results[0]]
mhw = xr.concat(mhw_results, dim='cell')
mhw = mhw.set_xindex(dims)
mhw = mhw.unstack(dim='cell')
As after groupby.aggregate operation coordinates are completely lost, they need to be re-added in the aggdf() function.
Finally the check_coordinates() function in stats.py had to be adapted as now the stacked dimension is a dimension without coordinate
To solve issue #49 caused by changes to the latest xarray:
In both threshold() and detect() was necessary to re-assign the coordinates, reset the "stacked" array using set_xindex to be able to unstack again, for example: