Support xarray coordinates and data variables in verde.get_region #304
Labels
enhancement
Idea or request for a new feature
good first issue
Good for newcomers (doesn’t require deep knowledge of the project)
Milestone
Description of the desired feature
The function uses
np.min
andnp.max
to get the bounding region of the given set of coordinates. This doesn't work if the coordinates are coming from xarray because the min and max functions return an array instead of a float. This causes non-obvious failures later on in the code when we try to use the region that came from this function.To have this function behave properly for those inputs, it might need to check if the input or output has a
.values
attribute (identifying the xarray object or something like it) and use that instead of the variable. It could be done on the input or on the output (which might be the best option).Are you willing to help implement and maintain this feature? Yes
The text was updated successfully, but these errors were encountered: