Add elements attribute to TPR parser#2858
Conversation
Elements are read from the TPR. TPR files contain the atomic number for each atoms, when an atom does not match an element (some virtual sites, coarse-grained particles), the atomic number is set to -1. The TPR parser adds the 'elements' attribute only if at least 1 atom has its atomic number correspomding to an element. In that case, atoms that do not match an element have theire element set to an empty string. See #2553 Closes #2628
Codecov Report
@@ Coverage Diff @@
## develop #2858 +/- ##
===========================================
+ Coverage 92.70% 92.77% +0.06%
===========================================
Files 185 185
Lines 24154 24676 +522
Branches 3128 3133 +5
===========================================
+ Hits 22391 22892 +501
- Misses 1717 1738 +21
Partials 46 46
Continue to review full report at Codecov.
|
I was afraid somebody would ask... Done now. |
IAlibay
left a comment
There was a problem hiding this comment.
I was afraid somebody would ask... Done now.
Y'all taught us too well :)
As far as I understand the TPR parser, lgtm!
package/CHANGELOG
Outdated
| * Added Hydrogen Bond Lifetime via existing autocorrelation features (PR #2791) | ||
| * Added Hydrogen Bond Lifetime keyword "between" (PR #2791) | ||
| * Dead code removed from the TPR parser and increased test coverage (PR #2840) | ||
| * TPR parser exposes the elements topology attribute (PR #2858) |
There was a problem hiding this comment.
Issue number could be useful here too.
lilyminium
left a comment
There was a problem hiding this comment.
LGTM, but I think there's a typo in the property docstring :-)
| * Atoms: number, name, type, resname, resid, segid, mass, charge, element | ||
| [residue, segment, radius, bfactor, resnum, moltype] | ||
| * Bonds | ||
| * Angels |
| """ | ||
| The symbol of the atom element. | ||
|
|
||
| Returns |
There was a problem hiding this comment.
It's odd to think of a property "returning" something, but on the other hand very few people will see this
Fix typo after suggestion by @lilyminium Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com>
|
@lilyminium @IAlibay Thank you for the review. I think I addressed all your comments. |
|
@IAlibay @lilyminium thank you for reviewing. I just put you down as the official assignees so one of you has the honor of merging. |
Elements are read from the TPR. TPR files contain the atomic number for
each atoms, when an atom does not match an element (some virtual sites,
coarse-grained particles), the atomic number is set to -1.
The TPR parser adds the 'elements' attribute only if at least 1 atom has
its atomic number corresponding to an element. In that case, atoms that
do not match an element have their element set to an empty string.
See #2553
Closes #2628
PR Checklist