Generalize selections
This just came to my mind during the improvement of warnings and error handling: Is there any reason to keep the group selection in each module class? I think no or do we have any module that would break?
I would suggest to pull the selection out and write add a proper text based selection function (like in gromacs) in the __main__.py
. To achieve this each module has to specifiy if it either can handle
- A single AtomGroup
- Several AtomGroups from the same universe
- All atoms of a universe
Of course we have to check that for several AtomGroups these are really from the same universe, since in principle one could also pass something like module([u.atoms, v.atoms], ...)
from the python interpreter.
For the third option I am not sure that this really exists. To be clearer: Is there any analysis that only works if doesn't know all molecules of the simulation? What do you think? If this is not the case the code of the selection function would be easier...