Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

BUG: sparse: downcast 64-bit indices safely to intp when required #3389

Merged
merged 1 commit into from Feb 25, 2014

Conversation

Projects
None yet
3 participants
Owner

pv commented Feb 25, 2014

Downcast 64-bit indices to 32-bit intp when required, but check
whether this is a safe operation, to be sure.

ufunc.reduceat and np.bincount deal only with intp data type.

@pv pv BUG: sparse: downcast 64-bit indices safely to intp when required
Downcast 64-bit indices to 32-bit intp when required, but check
whether this is a safe operation, to be sure.

ufunc.reduceat and np.bincount deal only with intp data type.
1cc1dff

@pv pv added this to the 0.14.0 milestone Feb 25, 2014

Owner

rgommers commented Feb 25, 2014

Thanks! Solves most issues with numpy 1.8.0 on 32-bit.

Owner

rgommers commented Feb 25, 2014

And the remaining one is taken care of by gh-3388

Owner

pv commented Feb 25, 2014

There are probably still issues in the _csparsetools.pyx stuff, as they seemed to appear in the setdiag PR. The setdiag PR itself is probably innocent in this...

Owner

rgommers commented Feb 25, 2014

TravisCI happy, so merging.

Coverage Status

Coverage remained the same when pulling 1cc1dff on pv:sparse-downcast into 77a7e48 on scipy:master.

@rgommers rgommers added a commit that referenced this pull request Feb 25, 2014

@rgommers rgommers Merge pull request #3389 from pv/sparse-downcast
BUG: sparse: downcast 64-bit indices safely to intp when required
047ffca

@rgommers rgommers merged commit 047ffca into scipy:master Feb 25, 2014

1 check passed

default The Travis CI build passed
Details
Owner

rgommers commented Feb 25, 2014

There's one issue with this fix: the minlength keyword to bincount was introduced in numpy 1.6.0. Solution to manually increase return length from bincount for 1.5.x, or is there an easier way?

EDIT: of course not with this solution, but with these lines of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment