Closed aleaverfay closed 1 year ago
Fix looks good!
For the unit test, I can't help but feel that this is treating a symptom rather than the cause.
In my mind, this bug made it in because the new code being added (omega) was not being tested on variety of inputs.
Could we perhaps enhance the 'test_whole_pose_scoring_module_single' (or _10, or add a new '_diverse') functions to test on a variety of structures rather than just UBQ1? For example, even just adding a disulfide structure would expose issues with variable numbers of connections.
This would increase the burden of defining baselines, but it seems worth it to me. I guess we could have a "score_smoke" test that doesn't compare the baselines and is just there to catch proper errors, at least.
More testing would be a good idea in any case. In this instance, though, the error is because there are times when we ask one piece of code to evaluate a term like rama on the n-term and the "phi" for the n-terminal residue type is undefined -- then, when we go to resolve the atoms that define phi for this residue, the uaid for the first phi atom is (-1, -1, -1) and instead of exiting gracefully, the resolve_atom_from_uaid function reads the -1 position from one of the tensors.
(Certain terms should handle this "not a valid uaid" case, e.g. Dunbrack. Those terms will need to intercept the -1 returned by resolve_atom_from_uaid and reinterpret it as specifying the neutral phi.)
Patch coverage: 94.96%
and project coverage change: -0.01%
:warning:
Comparison is base (
3b15d57
) 95.19% compared to head (dc83d7e
) 95.18%. Report is 1 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The unresolved-atom-id resolution code should also handle cases when UAIDs specify the "this is not a real UAID" condition. Previously, it just accessed out of bounds memory locations. Oops.
I have now added unit tests for UAID resolution as well. This test hits the case where the old resolve_atom_from_uaid function would have read out of bounds (though, that would not necessarily have triggered a failure).