BUG: fix windows pointer size problem #3385

Merged
merged 2 commits into from Jul 14, 2014

Conversation

Projects
None yet
3 participants
Owner

GaelVaroquaux commented Jul 14, 2014

Fix windows test failure.

@larsmans larsmans and 1 other commented on an outdated diff Jul 14, 2014

sklearn/cluster/k_means_.py
@@ -895,7 +896,8 @@ def _mini_batch_step(X, x_squared_norms, centers, counts,
% n_reassigns)
if sp.issparse(X) and not sp.issparse(centers):
- assign_rows_csr(X, new_centers, np.where(to_reassign)[0],
+ assign_rows_csr(X, new_centers,
+ astype(np.where(to_reassign)[0], np.int64),
@larsmans

larsmans Jul 14, 2014

Owner

This is going to break on a 32-bit box.

@larsmans

larsmans Jul 14, 2014

Owner

The correct type to use here is np.intp. However, I'm really surprised that that's not what np.where produces. What's the output of

print(np.where([0])[0])
print(np.intp)

on Windows?

@GaelVaroquaux

GaelVaroquaux Jul 14, 2014

Owner

This is going to break on a 32-bit box.

Yes, it should be an intp!'! You're better than continuous integration.

@larsmans

larsmans Jul 14, 2014

Owner

Funny, looks like np.where is not 64-bit clean. Good to know that.

@GaelVaroquaux GaelVaroquaux BUG: fix windows pointer size problem
9d1c723

Coverage Status

Changes Unknown when pulling 9d1c723 on GaelVaroquaux:fix_intp into * on scikit-learn:master*.

@GaelVaroquaux GaelVaroquaux FIX: try to get windows working
be643c9
Owner

GaelVaroquaux commented Jul 14, 2014

AppVeyor has confirmed that this is fixing the problem. Merging!

GaelVaroquaux merged commit ebdeddb into scikit-learn:master Jul 14, 2014

0 of 2 checks passed

continuous-integration/appveyor Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment