-
Notifications
You must be signed in to change notification settings - Fork 723
Optimize the calculation speed and logic of InterRDF_s
to ensure that the results are consistent with InterRDF
#5073
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
base: develop
Are you sure you want to change the base?
Conversation
…erRDF_s to optimize redundant np.histogram calls. Additionally, divided by N in _conclude to make the computation consistent with InterRDF.
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.
Hello there first time contributor! Welcome to the MDAnalysis community! We ask that all contributors abide by our Code of Conduct and that first time contributors introduce themselves on GitHub Discussions so we can get to know you. You can learn more about participating here. Please also add yourself to package/AUTHORS
as part of this PR.
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 contribution! With any code rewrite for performance, the first thing is to make sure that the existing tests still pass. Have a look at the test output (you can run the tests locally, too) and modify your code so that it produces the same results as before.
If you have any reason to belief that the new code produces correct output while the old code is incorrect, please start a discussion.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5073 +/- ##
===========================================
+ Coverage 93.62% 93.83% +0.20%
===========================================
Files 177 177
Lines 22001 22005 +4
Branches 3114 3115 +1
===========================================
+ Hits 20599 20648 +49
+ Misses 947 901 -46
- Partials 455 456 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@orbeckst Commits and testing:
I don't use tests very often, so I've briefly described the test situation here. I hope to discuss with you how to make reasonable modifications further. |
Refactored bin index calculation in the _single_frame function of InterRDF_s to optimize redundant np.histogram calls. Additionally, divided by N in _conclude to make the computation consistent with InterRDF.
Fixes #5067
Changes made in this Pull Request:
InterRDF_s._single_frame
to avoid multiple redundantnp.histogram
calls, improving performance._conclude
to divide byN
, ensuring consistency withInterRDF
.PR Checklist
package/CHANGELOG
file 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.
📚 Documentation preview 📚: https://mdanalysis--5073.org.readthedocs.build/en/5073/