Skip to content

Implementing Numpy Performance Improvements for Array Copying#4987

Merged
tylerjereddy merged 2 commits intoMDAnalysis:developfrom
lexi-x:arrays
Mar 21, 2025
Merged

Implementing Numpy Performance Improvements for Array Copying#4987
tylerjereddy merged 2 commits intoMDAnalysis:developfrom
lexi-x:arrays

Conversation

@lexi-x
Copy link
Copy Markdown
Contributor

@lexi-x lexi-x commented Mar 21, 2025

Fixes #2063

Changes made in this Pull Request:

  • Removes redundant allocation for situations where arrays are copied into preallocated arrays
  • Replaces reallocation with np.copyto()

PR Checklist

  • Issue raised/referenced?
  • Tests updated/added?
  • Documentation updated/added?
  • package/CHANGELOG file updated?
  • Is your name in 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.


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

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.41%. Comparing base (dcaa087) to head (dfeffc9).
Report is 19 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4987      +/-   ##
===========================================
- Coverage    93.42%   93.41%   -0.02%     
===========================================
  Files          177      189      +12     
  Lines        21859    22925    +1066     
  Branches      3078     3078              
===========================================
+ Hits         20422    21415     +993     
- Misses         986     1059      +73     
  Partials       451      451              

☔ 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.

Copy link
Copy Markdown
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @lexi-x

Copy link
Copy Markdown
Member

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a bit borderline that it is worth the churn, but I agree it is probably slightly more efficient.

@tylerjereddy tylerjereddy merged commit 35d9d2e into MDAnalysis:develop Mar 21, 2025
25 of 26 checks passed
Abdulrahman-PROG pushed a commit to Abdulrahman-PROG/mdanalysis that referenced this pull request Apr 13, 2025
…ysis#4987)

* faster array copying

---------

Co-authored-by: Lexi Xu <you@example.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Numpy Performance Improvements

3 participants