-
-
Notifications
You must be signed in to change notification settings - Fork 26k
MNT Common tests between KDTree and BallTree #16338
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
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.
Nice, thanks @VarIr !
@pytest.mark.parametrize('Cls', [KDTree, BallTree]) | ||
@pytest.mark.parametrize("kernel", ['gaussian', 'tophat', 'epanechnikov', | ||
'exponential', 'linear', 'cosine']) | ||
@pytest.mark.parametrize("h", [0.01, 0.1, 1]) | ||
@pytest.mark.parametrize("rtol", [0, 1E-5]) | ||
@pytest.mark.parametrize("atol", [1E-6, 1E-2]) | ||
@pytest.mark.parametrize("breadth_first", [True, False]) |
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.
This actually runs 288 tests ! is it reasonably fast ?
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.
On my local machine: 288 passed in 1.72s
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.
For comparison: the old test_kd_tree_kde
uses loops inside and results in 18 passed in 0.67s
. Doubling for balltree, we have like 0.4s overhead.
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.
It should be fine. Thanks for checking.
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.
Thank you for the PR @VarIr !
Reference Issues/PRs
More common tests between KDTree and BallTree. See also #15148 and #16110 (comment).
What does this implement/fix? Explain your changes.
From the previous PR by @rth :
Any other comments?
There might also be some overlap with
KernelDensity
, which is not dealt with in this PR.For example,
compute_kernel_slow
,test_kernel_density