fix: map reference atoms to their residue for no_intra_molecular - #182
Open
galjos wants to merge 1 commit into
Open
fix: map reference atoms to their residue for no_intra_molecular#182galjos wants to merge 1 commit into
galjos wants to merge 1 commit into
Conversation
The no_intra_molecular branch looked up residue_atom_indices with the atom index of the reference particle, but that list has one entry per residue, not per atom. Whenever a reference atom index was smaller than the number of residues the analysis quietly subtracted the atoms of an unrelated molecule, so a reference particle kept its own bonded partners and the intramolecular peak survived; the wrong pair count also fed the target density, misnormalising g(r). For systems where a reference index exceeded the number of residues, such as a pure water box, the lookup raised IndexError and the run aborted. This is the default path for input files that give both a restart file and a moldescriptor file. Translate the atom index through residue_numbers before indexing the per-residue list. In topologies without residues residue_numbers is the identity, so that case is unchanged.
Contributor
|
PYLINT REPORT Your code has been rated at 9.78/10 Full reportRaw metrics
Duplication
Messages by category
% errors / warnings by module
Messages
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #182 +/- ##
==========================================
+ Coverage 93.86% 93.94% +0.07%
==========================================
Files 177 177
Lines 9215 9228 +13
==========================================
+ Hits 8650 8669 +19
+ Misses 565 559 -6
🚀 New features to boost your workflow:
|
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.
The intramolecular exclusion indexed the per residue list of atom indices with a per atom index, so it excluded the wrong atoms or raised an index error depending on the system.
The reference atom is now mapped to the residue it belongs to before its atoms are excluded. The added test pins the exclusion against a hand computed expectation rather than against the previous output.
Present in v1.5.0. 949 tests pass in both type checking modes.