-
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
make empty sphzone / cyzone selections consistent with 'around' #2915
Comments
That's odd, I can't seem to reproduce this locally with: u = mda.Universe(GRO, XTC)
u.select_atoms('resname SOL and sphzone 3 (resid 12 and name HA)') |
@IAlibay Sorry, I noticed that I have made an error and this is a different problem. |
So the behaviour here is inconsistent between around & sphzone/cyzone. In the former if the selection is an empty atomgroup we just return an empty atomgroup: mdanalysis/package/MDAnalysis/core/selection.py Lines 276 to 280 in 23074c6
whilst in the latter selections that check isn't being made. My proposal here would be to align everything to |
I agree with #2915 (comment) - make |
Note that some more details are shown in the duplicate issue #3026. |
Hi, I was going through the code and found out that many other selections are also not consistent with |
Hi @sulays Thanks for your interest. I think this is a very good idea. It might be good to raise these selections as issues (explain what you expect and what you got) and then make a PR against them. |
…. Sphzone operating on an empty selection now returns an empty atom group.
…testing to confirm.
Is your feature request related to a problem?
Since sphzone will do a center of geometry calculation first, if an empty atomgorup is passed to the sphzone, a not very useful error message will be given.
Describe the solution you'd like
An error message which says the selection is empty could be given.EDIT: Following the discussion below and on #3026 we want these selections to behave like
around
, i.e., just return an empty AtomGroup. — @orbeckstDescribe alternatives you've considered
Just return an empty atomgroup.
The text was updated successfully, but these errors were encountered: