Repository navigation
Fix residue conformational state indexing by group id - #459
Merged
harryswift01 merged 3 commits intoOct 14, 2026
Merged
harryswift01 merged 3 commits into
harryswift01 merged 3 commits into
Conversation
jimboid
approved these changes
Oct 14, 2026
jimboid
left a comment
Member
There was a problem hiding this comment.
Looks like this fixes a real bug behind at least one reported issue. Happy to merge.
skfegan
approved these changes
Oct 14, 2026
skfegan
left a comment
Member
There was a problem hiding this comment.
This looks good. Hopefully the tests ensure that this issue doesn't recur.
harryswift01
deleted the
368-bug-investigate-ambiguous-residue-conformational-state-indexing
branch
October 14, 2026 15:12
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.
Summary
This PR fixes residue-level conformational entropy being reported as 0.0. Residue states were stored in a list that was pre-filled with one empty list per group and then appended to, so lookups by group id read the empty placeholders. The residue states and flexible-dihedral counts are now keyed by group id, and the regression baselines affected by the correction are regenerated.
Changes
Key residue conformational state accumulators by group id:
states_resandflexible_resinconformational_state_builder.pyare nowdict[int, ...]instead of lists, and the return annotations are updated to match._merge_group_state_datainstate_assignment.pytakesgroup_idand assignsstates_res[group_id]andflexible_res[group_id]instead of appending.number_groups.Update unit tests for group-keyed states:
[[], []]for a single group, which encoded the indexing bug.group_idto check the key is used and not the insertion order.Update regression baselines:
Impact
customised_axes: false, frames 0-5 step 2), group 0 residue Conformational goes from 0.0 to 5.292271495278918, matching the issue.flexible_resis no longer indexed by position, so skipped or non-contiguous groups can't read another group's value. A missing group now raisesKeyError.