-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG+1] FIX support memmap scalars as CV scores #6789
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
Conversation
scoring=lambda est, X, y: scores) | ||
except Exception: | ||
raise | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Souldn't this be a 'finally', rather than an else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's what I mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just not thinking straight today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
LGTM. +1 for merge |
tf.write('Hello world!!!!!') | ||
tf.close() | ||
scores = np.memmap(tf.name, dtype=float) | ||
score = scores.sum() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am following correctly your test relies on a sum of memmap to be a memmap 0d array. This is no longer the case in numpy master, see numpy/numpy#7406 for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use
score = np.memmap(tf.name, shape=(), mode=w+, dtype=float)`
which will create a memmap 0d array. This will get rid of the Python 3.5 failure as well (you forgot the b
prefix when writing to the file).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, thanks. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I was hoping that was not permanent numpy behaviour, but it is because of that behaviour that this is an issue for us.
Thanks! |
* FIX support memmap scalars as CV scores * FIX test for Python 3.5 and NumPy 1.12
* FIX support memmap scalars as CV scores * FIX test for Python 3.5 and NumPy 1.12
Reference Issue
Fixes #6783
What does this implement/fix? Explain your changes.
The test - which introduces a cross-validation score of type np.memmap - fails without the patch.