-
Notifications
You must be signed in to change notification settings - Fork 664
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
Residue & Segment slicing. Residue.select_atoms? #1163
Comments
For me.
|
I agree with @kain88-de 👍
EDIT: I think class XGroup():
def select_atoms(....):
return self.atoms.select_atoms(...) so that it works as expected, i.e., it selects from within the atoms unless globals are selected. |
Another vote for @kain88-de's choice. |
I'm in favor of @kain88-de's proposed approach as well. I don't think |
"Technically" is not really important from a user's point of view. I liked Residue = group of atoms (and Segment = group of residues) because it makes sense semantically. Could we have Residues and Segments behave like such groups? |
@orbeckst the problem is then that if you want a I'm looking for the thread where we discussed this, because we definitely settled this question a long time ago IIRC. |
Yeah I think David is right about attribute access having to refer to the
Residue and never the atoms.
My question is with the special getitem and contains methods, isn't the
intent clear that we're trying to use the Residue as a group?
…On Mon, 16 Jan 2017, 7:20 p.m. David Dotson, ***@***.***> wrote:
@orbeckst <https://github.com/orbeckst> the problem is then that if you
want a Residue to behave both as an AtomGroup *and* a Residue, then it
will have attributes like charge (for the Residue's charge) and charges
(for the charge on each atom). I think there were other cases where
basically merging the API of a Residue and an AtomGroup under the new
scheme causes clashes in expected functionality like this, and so then some
things will work like an AtomGroup while others will not. *That* is more
confusing for users in my view than just being explicit with e.g.
Residue.atoms.
I'm looking for the thread where we discussed this, because we definitely
settled this question a long time ago IIRC.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1163 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AI0jB-lsjtxDR5QF0kEUMAzE1KfNfgpbks5rS8MCgaJpZM4LkyQ->
.
|
@dotsdl yes, if you could dig out that thread. I would expect If this is technically hard to do – fine, we have to figure out where to spend developer time – but from a semantic perspective it would be meaningful and unambiguous. I would argue that not having this behavior introduces some metaphor shear into the UI. |
@orbeckst see here for your own conclusion and here for some extended discussion. My worry is that @richardjgowers those mechanisms were things I was resistant to adding back in, but they were added back to maintain things that were present in the old system. I don't like them, since I think they cause us metaphor shear as @orbeckst says. |
@dotsdl : I agreed that I guess we had the discussion on
I'll stop flogging a dead horse ... (even though I am not convinced that it is ambiguous as to what should happen when referring downward: in my mind a The hard line view would be that neither
|
Cool thanks for the quick consensus |
I'm going over the old tests in test_atomgroup and found some differences in behaviour between the old and new systems. Because Residue and Segment used to be derived from AtomGroup, these could be sliced to give atoms.
This also applies to things like
__contains__
, shouldatom in res
work?Also,
select_atoms
now has to be called off either a Universe or AtomGroup object, but because it explicitly says_atoms
in the method name, shouldn't this always work off any object? (ie withSegmentGroup.select_atoms
it's obvious what is meant, so allow it?)I'm in favour of changing these things back to how they used to work, but just checking this seems better with everyone else.
poking @dotsdl in particular
The text was updated successfully, but these errors were encountered: