Repository navigation
Expose computed density in InterRDF results - #5482
sumitsaraswat362 wants to merge 12 commits into
Conversation
Documentation build overview
10 files changed ·
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5482 +/- ##
========================================
Coverage 93.88% 93.89%
========================================
Files 184 184
Lines 22640 22657 +17
Branches 3217 3221 +4
========================================
+ Hits 21256 21273 +17
Misses 920 920
Partials 464 464 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I think that trying to compute the average density value in the norm="density" case might lead to zero division erros given that a nonzero box_vol is not actually required in these cases in order to compute the distance dependent density. Probably the two cases should be handled separately. I am talking about the line 401 of the diff. I am not an expert or anything though so I would wait someone with more expertise to express his opinion obviously. I was just practicing code reviewing and understing. |
- Only compute results.density/results.rho when box_vol > 0, otherwise set to None - Expose results.rho alias alongside results.density as suggested in MDAnalysis#5362
|
Thanks for the great catch, @sici17! You are completely right—for non-periodic trajectories or simulations without box dimensions where I've just pushed a commit guarding against this:
Really appreciate you taking the time to review! |
|
Before we can review this PR, please restore the original PR template https://github.com/MDAnalysis/mdanalysis/blob/develop/.github/PULL_REQUEST_TEMPLATE.md and answer all questions. |
|
@orbeckst I have restored the official PR template in the PR description and answered all questions, updated @sici17 Good catch! I added guards for zero box volume / non-periodic systems ( |
orbeckst
left a comment
There was a problem hiding this comment.
Quick initial review
- only include
results.density(dropresults.rho) — there should be only one way to access the data - add documentation, for instance,
results.densityneeds to be explained where the otherresultsattributes are listed; add a.. versionadded:: 2.11.0
These are the first things I noticed, there may be more comments.
|
Please also resolve the conflicts with the develop branch. |
|
@orbeckst Thanks for the review! I have addressed the points:
|
orbeckst
left a comment
There was a problem hiding this comment.
The computed "density" is results.density because it's not a density.
(Furthermore, it's confusing because norm="rdf gives results.rdf and then people/LLMs may look for results.density for norm="density".)
We could store it as results.normalization_density or something like that. What would be a good name? Does it still make sense to store this quantity or should we be storing
Whatever we store, we need then document properly, i.e., write down the equations that define the quantity.
We cannot really continue with the PR until we have decided this.
|
Thank you for pointing this out, Oliver. You are completely right. The quantity I have updated the implementation to address this:
The equations and physical definitions have been added to the docstrings of both |
Fixes #5362
Changes made in this Pull Request:
results.density(and aliasresults.rho) inInterRDFandInterRDF_swhennormis"rdf"or"density".test_rdf.pyandtest_rdf_s.py.package/CHANGELOGandpackage/AUTHORS.LLM / AI generated code disclosure
LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: no
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.