Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Have LinearDensity support updating AtomGroups, more intuitive names, save bins #2508
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
# Get masses and charges for the selection try: # in case it's not an atom self.masses = np.array([elem.total_mass() for elem in group]) self.charges = np.array([elem.total_charge() for elem in group]) except AttributeError: # much much faster for atoms self.masses = self._ags.masses self.charges = self._ags.charges self.totalmass = np.sum(self.masses)
Describe alternatives you've considered
This all sounds extremely sensible to me.
For 1.0 we could break the API but if there's a way to keep the old data structures around (maybe hide them behind managed attributes that create them on the fly from the new real data structures) then that would help users who just want their old stuff to still work with the last py2 release but set us up for a clean removal for 2.0.
With properties for the old attributes we can also easily issue deprecation warnings.