-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
FIX Updated loop structure in hdbscan _tree.pyx
to avoid error
#26547
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
cc: @jeremiedbb @lesteve |
for idx in range(PyArray_SHAPE(<cnp.PyArrayObject*> condensed_tree)[0]): | ||
condensed_node = condensed_tree[idx] |
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.
Why do you need that ? I'd expect condensed_tree.shape[0]
to work
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.
With the new NumPy API the use of .shape
errors.
See: #26385 (comment)
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.
LGTM if CI is green.
Locally
Hmmm weird, out of curiosity can you elaborate on this? In particular how do we get a float instead of an int eventually? |
Ooops sorry, this issue is about pypy. Since I was pinged, I thought this was about scipy-dev #26535 my bad 😅 ... |
Merging, thanks! |
Reference Issues/PRs
Fixes #26541
What does this implement/fix? Explain your changes.
For some reason, for-each style iteration of structured dtype numpy arrays no longer works. This PR replaces that loop usage with standard indexing. It may be worth investigating what caused it upstream.
Any other comments?