Skip to content
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

BUG: sparse: Use _ascontainer for argmin/argmax #18121

Merged
merged 4 commits into from
Mar 27, 2023

Conversation

perimosocordiae
Copy link
Member

Reference issue

Fixes gh-18111

What does this implement/fix?

The current implementation of sparse arrays relies on the use of _container and _ascontainer classmethods to dispatch to the correct output type when returning dense results. In this case, we'd overlooked a callsite that was unconditionally invoking np.matrix.

@perimosocordiae perimosocordiae added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse labels Mar 10, 2023
@j-bowhay j-bowhay added this to the 1.11.0 milestone Mar 10, 2023
@tylerjereddy tylerjereddy added the backport-candidate This fix should be ported by a maintainer to previous SciPy versions. label Mar 11, 2023
@tylerjereddy
Copy link
Contributor

I rebased on latest main--if CI is green I think we'll be good to go here.

@tylerjereddy tylerjereddy merged commit e799ae4 into scipy:main Mar 27, 2023
@tylerjereddy
Copy link
Contributor

I had to restart one job, but after that CI was all green. I squash-merged to make it easier to backport if we do another 1.10.x release.

@tylerjereddy tylerjereddy modified the milestones: 1.11.0, 1.10.2 Apr 16, 2023
tylerjereddy pushed a commit to tylerjereddy/scipy that referenced this pull request Apr 16, 2023
* BUG: sparse: Use _ascontainer for argmin/argmax

* Adding test coverage

* Remove unused import

* skip sparse formats that don't support min/max
@tylerjereddy tylerjereddy removed the backport-candidate This fix should be ported by a maintainer to previous SciPy versions. label Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: sparse.csr_array.argmax() returns 2D numpy.matrix instead of 1D numpy.ndarray
3 participants