-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
fixed asscalar error on floats #10659
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
This fixes #4701, I think |
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.
See #5126 (comment) where it was suggested to just leave things as is. If we do that, we should at least close the issue! Though I think we might as well just apply this fix, and add the test (see in-line comments).
numpy/lib/tests/test_type_check.py
Outdated
class TestAsScalar(object): | ||
|
||
def test_basic(self): | ||
a = asscalar(np.array([1])) |
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.
Use np.asscalar
numpy/lib/tests/test_type_check.py
Outdated
def test_basic(self): | ||
a = asscalar(np.array([1])) | ||
assert_equal(a.__class__, int) | ||
assert_raises(ValueError, asscalar,[1,2]) |
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.
Please add spaces after ,
(pep8)
fixed error encountered on passing floats to asscalar().
done at HackIllinois 2018