Skip to content

Conversation

@Aryaman-Chaudhri
Copy link

@Aryaman-Chaudhri Aryaman-Chaudhri commented Dec 29, 2025

Fixes #5114

Changes made in this Pull Request:

-Added benchmarks/benchmarks/neighbors.py proving scipy.spatial.cKDTree is faster than the existing Implemetation.

-Implemented scipy.spatial.cKDTree backend in package/MDAnalysis/lib/pkdtree.py by building a new class.

-Updated testsuite/MDAnalysisTests/lib/test_pkdtree.py to verify both PeriodicKDTree (for API stability) and AugmentedPKDTree.

-Updated package/AUTHORS and package/CHANGELOG to reflect the contribution.

PR Checklist

Developers Certificate of Origin

I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.


📚 Documentation preview 📚: https://mdanalysis--5193.org.readthedocs.build/en/5193/

@BradyAJohnston BradyAJohnston self-requested a review December 30, 2025 10:26
@BradyAJohnston
Copy link
Member

Thanks for working on this. Before we do any kind of review we need you to address the currently failing tests and also format using black to pass the linting checks.

@Aryaman-Chaudhri Aryaman-Chaudhri force-pushed the implement-scipy-pkdtree branch from 2247551 to 8abf284 Compare January 6, 2026 18:55
@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 82.14286% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.65%. Comparing base (9fb8b0a) to head (b60ccf1).
⚠️ Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
package/MDAnalysis/lib/pkdtree.py 82.14% 10 Missing and 10 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5193      +/-   ##
===========================================
- Coverage    92.72%   92.65%   -0.08%     
===========================================
  Files          180      180              
  Lines        22472    22585     +113     
  Branches      3188     3219      +31     
===========================================
+ Hits         20838    20926      +88     
- Misses        1176     1190      +14     
- Partials       458      469      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Aryaman-Chaudhri
Copy link
Author

Hi @BradyAJohnston , just a quick question , during working on this task , I was wondering why is 'nsgrid' not implemented anywhere , based on documentation it does have a few flaws but seems to be a well optimized and a fast function (also O(N)) atleast on paper.

@orbeckst
Copy link
Member

orbeckst commented Jan 6, 2026

@BradyAJohnston do you want to take on shepherding this PR? If so, please assign it to you.

I am happy to review (once linters pass).

@BradyAJohnston BradyAJohnston self-assigned this Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use native scipy periodic KDTree for orthorhombic boxes?

3 participants