All spatial coordinates of ds_out are transferred to the regridder's output (DataArray or Dataset). A "spatial coordinate" is any member of ds_out.coords whose dimensions are a subset of those of lon and lat.
To achieve this relatively elegantly, I modified all the internal properties we set on the regridder object to a simple out_coords dict. If ds_out was passed as a dictionary, the conversion to xarray objects now happens in the __init__.
Changed the logic for locstream_out : if the locstreams are passed as DataArrays and they do not have the same dimension, xESMF will raise an error because that doesn't make sense. (before it would only raise an error if they had different lengths).
Grid mappings variables are also transferred to the output. However, I don't think cf-xarray has a way to parse those. Thus, I needed to guess their names from the data variables attributes. This means this feature is a bit limited for now, and it feels sketchy for the regridder object to inspect the data of ds_out rather than only the coordinates. A better mechanism should wait for such a feature in cf-xarray.
Other unrelated changes:
Fixed a test that failed with python >= 3.8
Updated all pre-commit hooks
Removed blank panels in the "Comparison of 5 regridding algorithms" notebook.
Added a line in CHANGES.rst about the fix in conda's dependencies (#168).
After this PR, I think we could publish v0.6.3 to fix the conda builds?
This fixes #167.
ds_out
are transferred to the regridder's output (DataArray or Dataset). A "spatial coordinate" is any member ofds_out.coords
whose dimensions are a subset of those oflon
andlat
.out_coords
dict. Ifds_out
was passed as a dictionary, the conversion to xarray objects now happens in the__init__
.cf-xarray
has a way to parse those. Thus, I needed to guess their names from the data variables attributes. This means this feature is a bit limited for now, and it feels sketchy for the regridder object to inspect the data ofds_out
rather than only the coordinates. A better mechanism should wait for such a feature incf-xarray
.Other unrelated changes:
After this PR, I think we could publish v0.6.3 to fix the conda builds?