Repository navigation
perf(coordinates): optimize trajectory boolean indexing using flatnonzero (#1982) - #5500
Open
dhrubchatterjee16-lang wants to merge 1 commit into
Open
dhrubchatterjee16-lang wants to merge 1 commit into
dhrubchatterjee16-lang wants to merge 1 commit into
Conversation
Documentation build overview
9 files changed ·
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5500 +/- ##
========================================
Coverage 93.92% 93.92%
========================================
Files 184 184
Lines 22661 22663 +2
Branches 3223 3224 +1
========================================
+ Hits 21284 21286 +2
Misses 917 917
Partials 460 460 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
IAlibay
requested changes
Oct 20, 2026
IAlibay
left a comment
Member
There was a problem hiding this comment.
@dhrubchatterjee16-lang we require PRs to provide the information that is in the PR template before we review them. Please add the information back.
Author
|
Hi @IAlibay i have updated the PRs template. Please let me know if you would like me to adjust anything. |
dhrubchatterjee16-lang
force-pushed
the
fast-bool-frames-1982
branch
from
October 27, 2026 12:55
24bb126 to
74fa9c2
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1982
Changes made in this Pull Request:
MDAnalysis.coordinates.base.ProtoReader.__getitem__, replacednp.arange(len(self))[frame]withnp.flatnonzero(frame)when indexing with boolean masks, avoiding unnecessary intermediate array memory allocation and speeding up trajectory boolean indexing (7x–20x benchmarked speedup).len(frame) == len(self)andframe.ndim == 1), raisingIndexErroron mismatch to preserve standard NumPy indexing semantics.MDAnalysisTests.coordinates.test_reader_apicovering boolean mask indexing and length mismatch exceptions.package/CHANGELOGunder Enhancements.package/AUTHORS.LLM / AI generated code disclosure
LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: yes
PR Checklist
package/CHANGELOGfile updated?package/AUTHORS? (If it is not, add it!)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.