-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes #1795 #2074
fixes #1795 #2074
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went back to the code reported as problematic in the original issue and confirmed that the lastest develop (259f778) gives 40 residues on that selection and @richardjgowers feature branch here (e8a7863) gives 5, which is what the issue reporter expects / wants. So, I think mechanically this is fine & we should perhaps merge soon-ish to fix that mechanical issue.
I'd probably feel a little safer if we were to use the exact reported issue example as a regression test, but I trust that the test used here is similar enough & avoids the additional test data file burden.
I do have a few suggestions / comments, that are perhaps better suited to follow-up PRs or at least issues so we don't forget.
- the docs for sphzone / sphlayer still indicate that the COG / centroid of the ref group is used -- is this still true? If so, do we now gracefully handle the scenarios I was confused about in my diagram?
- the linked issue / PR discussions for this problem also raised some of my confusion about pbc-related flags in our code base (there's a few of them, it is confusing, etc.); does that persist?
- I don't know if some of the behavior adjustment here warrants i.e.,
versionchanged
directives in the docs; if a temporary bug just crept in maybe not I suppose
The Travis failure is likely unrelated -- we should maybe go ahead and do a crude pinning fix to the NumPy version there I suppose so we don't block PRs & then rebase here maybe. |
@tylerjereddy the centroid is still used, but it always assumes that all atoms are in the correct image to calculate this. WRT your sketch, if you had protein/X atoms in either side of the box this selection would fail because it would calculate the centroid as roughly the center of the box. This is exactly what unwrap would fix. In general |
I agree with @richardjgowers that this can only be fixed for the general case (atom coordinates in arbitrary images) by first wrapping and then unwrapping the system. But even then, PBC have to be taken into account when calculating the COG of the reference group (and afterwards when computing distances, but that's already handled correctly I think). If I'm not mistaken, this PR currently only works correctly for already unwrapped systems without PBC. |
@zemanj yep we need proper unwrap support. But this PR fixes the regression that happened when we started to use |
Could someone take the responsibility and merge? (I haven't really followed the conversation in depth but nothing has happened over the last 2d and the status is green so naively I'd think one could hit the button...) |
I think I addressed @tylerjereddy 's comments, so I'm merging this tl;dr there's still wrap/unwrap issues, but this fixes the regression that happened |
Fixes #1795
Changes made in this Pull Request:
primary unit cell when calculating center of reference group
PR Checklist