-
Notifications
You must be signed in to change notification settings - Fork 6
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
Using Sim selections #31
Comments
You have to give selections a name in order to generate them later; the usage should look like: ag = 'bynum 0:10'
S.selections.add('my favorite atoms', ag) Selections are stored as (lists of) selection strings, and they are applied on call to give back an AtomGroup from the active universe. I think it should be possible to feed AtomGroups in directly instead of selection strings, storing a list of atom indices instead of strings for the selection definition. BTW, you can avoid the (admittedly awkward) S.selections['my favorite atoms'] = 'bynum 1:10' and get the corresponding AtomGroup from the selection definition with: ag = S.selections['my favorite atoms'] I don't know if there's a clean way to handle |
Yeah I don't mind hacking in adding AtomGroups directly myself, I hate working in terms of selection strings myself. For the second point, there's the python method https://docs.python.org/2/library/operator.html#operator.iadd I forgot they're all key: value pairs, so possible things you could do S.selections += {'something': 'sel 1', 'somethign else': 'sel 2'}
S.selections += 'key', 'value' Food for thought at least |
I don't mind adding in these kind of enhancements so long as they can be unambiguously implemented at both the interface and persistence levels. I would suggest the following:
I prefer to keep MDAnalysis calls out of |
Closes Issue datreant#31 Changed core/aggregators/Selection getitem to route through add method Added _SelectionAtoms type to core/persistence/SimFile for storing indices core/persistence/SimFile add_selection can now add either selection strings or indices arrays (new).
Closes Issue datreant#31 Changed core/aggregators/Selection getitem to route through add method Added _SelectionAtoms type to core/persistence/SimFile for storing indices core/persistence/SimFile add_selection can now add either selection strings or indices arrays (new).
I was playing with the selections tool on Sims, and I bumped into a couple annoyances
I guess this ties in with #25 in accepting premade MDA objects. This should be possible as AtomGroups are unambiguous based on a hash of their Universe (to uniquely identify this among S.universes) and then just
ag.indices()
Using
.add()
feels weird to me, intuitively I want to+=
stuff in. Thoughts?The text was updated successfully, but these errors were encountered: