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: Compressed matrix indexing should return a scalar #10207

Merged
merged 1 commit into from
Jun 10, 2019

Conversation

peterbell10
Copy link
Member

Fixes gh-10206

This matches how indexing was done prior to 1.3:

return self.data[start + insert_pos_left:
start + insert_pos_right].sum(dtype=self.dtype)
else:
return np.compress(minor_index == self.indices[start:end],
self.data[start:end]).sum(dtype=self.dtype)

@tylerjereddy tylerjereddy added scipy.sparse defect A clear bug or issue that prevents SciPy from being installed or used as expected backport-candidate This fix should be ported by a maintainer to previous SciPy versions. labels May 22, 2019
Copy link
Contributor

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like SciPy CI isn't running at the moment! Or at least not showing up in the PR at the time of writing.

It should be possible to write a short regression test for this, right?

@peterbell10 peterbell10 changed the title BUG: Compressed matrix indexing should returns a scalar BUG: Compressed matrix indexing should return a scalar May 22, 2019
@peterbell10
Copy link
Member Author

Added extra check into the existing indexing test. Or would it be better as its own test?

Copy link
Member

@perimosocordiae perimosocordiae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the fix.

@perimosocordiae
Copy link
Member

I think the test is fine currently. Just need to wait for the CI to come back.

Copy link
Contributor

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, there's an approving review on the code + test from CJ and CI is all green now so I'll put this in, thanks @peterbell10 & CJ.

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.

sparse matrices indexing with scipy 1.3
4 participants