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
Support len() of multi-dim arrays in array analysis #4239
Conversation
This looks good, thank you for the patch. One tiny nitpick: you have used the 'blessed' repo
|
@esc looks like there was a problem with my remotes in this case. I'll delete the branch as soon as it's merged. |
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 for the patch, change seems good, wondering if the test can be extended opposed to altered (see comment). Thanks again!
numba/tests/test_array_analysis.py
Outdated
@@ -354,7 +354,7 @@ def test_12(): | |||
c = a[1:,:] | |||
d = b[:-1,:] | |||
e = c.shape[0] | |||
f = d.shape[0] | |||
f = len(d) |
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.
Perhaps this could be g = len(d)
and then use it in the return, and then assert equivalence over 'e', 'f', 'g'
so as to still retain the original check based on shapes and slices in the 2D array context?
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.
done.
Also, merging master into this PR will fix the flake8 failure. |
Thank you @stuartarchibald and @seibert . Applied the changes. |
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 for the fixes.
I've marked this for merge, the only fails on CI were due to 504's on platforms that don't support ParallelAccelerator. CI has been restarted. |
As title. The check for 1D array in
len
handling of array analysis is unnecessary.