Skip to content

Conversation

@keewis
Copy link
Collaborator

@keewis keewis commented Mar 20, 2021

sparse issued a release yesterday, which seems to break one of our tests (numpy.allcose on a ndarray and COO is not implemented). This enables installing the dev version of sparse in the upstream-dev CI, and I'm planning to either xfail or fix the failing test here.

Edit: I can reproduce the failure with sparse=0.11.2 so that's not the reason for the failing test... that's wrong, a new environment downgraded to sparse=0.11.2 will not fail, but upgrading will introduce the failure again.

  • Passes pre-commit run --all-files

@keewis
Copy link
Collaborator Author

keewis commented Mar 21, 2021

the reason for the failure seems to be that for sparse=0.11.2 dense_var.where(sparse_var) returns dense while for sparse=0.12 it returns sparse. We can fix that by casting ret_d.data to dense if it exists and is sparse:

    if isinstance(ret_d, xr.Variable) and isinstance(ret_d.data, sparse.SparseArray):
        ret_d = ret_d.copy(data=ret_d.data.todense())

but we can probably figure out a better way to compare dense and sparse arrays.

@andersy005 andersy005 mentioned this pull request Mar 22, 2021
4 tasks
@keewis
Copy link
Collaborator Author

keewis commented Mar 22, 2021

since the sparse (and pint) tests will eventually be superseded by #4972, we can skip finding a better way to compare sparse and dense arrays. I'll merge now to fix the CI in other PRs.

@keewis keewis merged commit fba449b into pydata:master Mar 22, 2021
@keewis keewis deleted the upstream-dev-sparse branch March 22, 2021 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant