-
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
BUG: Set default pbc sel flag to False #1806
Conversation
* Fixes Issue #1795 by setting the default value of use_periodic_selections flag to False. * Added corresponding unit test
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'm not sure this is the right fix. By changing a default won't we cause differences with all selections going forwards?
@tylerjereddy I think all that is needed is to remove the |
@richardjgowers Can you provide a simple test case / example where detection of the issue & correct outcome is obvious? If we added support for pbc sphzone stuff at some point in the past, there should have been a unit test to verify that it would make the correct selection if there's a straddling issue or whatever. |
Even a small / crude toy example could be useful if we use i.e., an empty universe to start with. It might take me a while before I get around to making one & the pbc stuff can be mind-bending to think about. I should also point out that the docs seem a bit misleading because we imply that |
One possible test might be something like below, where X is the "protein" and W are the "waters." Distinguishing between W3 & W4 in a unit test selection would partially clarify that we have a spherical selection wrapped about the boundary. However, if the coordinates of X are split over the periodic boundary, I'm afraid our documentation for sphzone clearly indicates that the centroid of X's coordinates is to be used for generating the sphere:
Those docs will need an overhaul or expansion to include PBC as well if we go that route. |
One might encourage a user to use wrapping (see: #246 ) before sphzone, but that's something that's currently up to them, I think. |
Yeah so our "pbc" flag doesn't correctly do wrapping, so currently a group of [W2, W3] will fail miserably in most selections. As far as fixing regressions in #1795 (ie this PR) we just need to take out the pbc kwarg in the selection. This then assumes that the user is working with a properly wrapped Universe. More generally we've got #1185 and #1760 which are about how pbc=True/False isn't enough and we probably need some wrapping functions which will be used in selections too. |
#1795 is now fixed, flags are also deprecated now |
Fixes #1795 and adds corresponding unit test. See the associated issue for more detailed analysis & discussion.
In short, we now set (and test that we set)
use_periodic_selections
flag toFalse
by default (it wasTrue
by default).Longer term, flags are to be removed and the unit test (etc.) will need to be mutated accordingly. There's also (confusingly) a
use_pbc
flag that is set (and tested to be set) toFalse
by default, but that is not used for the affected code in the original issue. That should perhaps be cleaned up, but we're planning to remove flags eventually anyway so perhaps better to hold over to that effort.