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
ENH: Add annotations for scipy.spatial.cKDTree
#14024
Conversation
Tests failures seem to be due to #14014 thus far. |
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.
IMO we should follow what we did in #13833. Have inline typing and also for int,float
use the things from scipy._lib._util
that this PR will introduce.
As far as I'm aware inline type hinting is not possible here, as the source is based on cython |
Ah right, I did see this was for cython files. |
Co-Authored-By: peterbell10 <13238737+peterbell10@users.noreply.github.com>
As discussed during the meetup. This is ready so I am merging. Thanks @BvB93! |
Reference issue
n.a.
What does this implement/fix?
This PR adds annotations to the
cKDTree
andcKDTreeNode
classes for the purpose of static type checking.Additional information
As we cannot describe array shapes/dimensionality as of yet, the output type is set to
Any
here.array shapes/dimensionality yet. This does mean that there is some small room for a false positive here,
though these are very much edge cases in my opinion.