-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge fails when sparse Dataset has overlapping dimension values #3445
Comments
Note that |
@El-minadero from the sparse API page I'm seeing two methods for combining data: import sparse
import numpy as np
A = sparse.COO.from_numpy(np.array([[1, 2], [3, 4]]))
B = sparse.COO.from_numpy(np.array([[5, 9], [6, 8]]))
sparse.stack([A,B]).todense()
Out[1]:
array([[[1, 2],
[3, 4]],
[[5, 9],
[6, 8]]])
sparse.concatenate([A,B]).todense()
Out[2]:
array([[1, 2],
[3, 4],
[5, 9],
[6, 8]]) Since this is an issue with |
The missing operation here in sparse is indexing like For reference, here's the traceback:
|
If the footprint and flux used in the inversion had differing lat/lon coordinates, then the basis functions will be aligned to the footprint (and "xsensitivity"), while the flux that is saved will not be aligned to the footprint. This causes a problem in some cases when trying to compute country totals. NOTE: we're using "override" because `inv_out.basis` is a sparse matrix and currently you can't forward fill in more than one dimension when using sparse matrices in xarray: pydata/xarray#3445
Sparse numpy arrays used in a merge operation seem to fail under certain coordinate settings. for example, this works perfectly:
But this raises an
IndexError: Only indices with at most one iterable index are supported.
from the sparse package:I have noticed this occurs when the merger would seem to add dimensions filled with nan values.
The text was updated successfully, but these errors were encountered: