Closed santisoler closed 3 years ago
That does feel like something we should handle automatically. What happens if you always run the variable through np.asarray
? It only copies when it needs to and ideally DataArrays should support this conversion without a copy.
I've been rethinking about this issue and concluded that I blamed Verde too quickly for a bug in Harmonica.
I think that the make_xarray_grid
is intended to be used on a Numpy -> Xarray workflow, so letting it accept xarray objects doesn't sound too clever. In fact, Xarray objects offers more robust ways to merge xarray objects into a single Dataset.
The origin of the bug in Harmonica is on the prism_layer
function, which is intended to work both with Numpy arrays and with Xarray objects. I'll fix that in a PR in Harmonica.
For this reason I'm closing this issue. If you or anyone thinks otherwise, please feel free to comment and/or reopen it if it's necessary.
Description of the problem
When passing
xarray
objects as arguments tovd.make_xarray_grid
we end up on somexarray
errors down the line.Full code that generated the error
Full error message
System information
conda list
below:output of conda list