diff --git a/pytim/interface.py b/pytim/interface.py index 25e910a3..4f375a38 100644 --- a/pytim/interface.py +++ b/pytim/interface.py @@ -90,6 +90,7 @@ def _assign_layers(self): @property def atoms(self): + if len(self._layers) == 0: return self._layers # an empty atom group return self._layers[:].sum() @property diff --git a/pytim/willard_chandler.py b/pytim/willard_chandler.py index 64dfc589..71bff17b 100644 --- a/pytim/willard_chandler.py +++ b/pytim/willard_chandler.py @@ -27,6 +27,7 @@ class WillardChandler(Interface): """ Identifies the dividing surface using the Willard-Chandler method + NOTE that this method does *not* identify surface atoms *(Willard, A. P.; Chandler, D. J. Phys. Chem. B 2010, 114, 1954–1958)* @@ -83,9 +84,20 @@ class WillardChandler(Interface): @property def layers(self): """ The method does not identify layers. + + Example: + + >>> import MDAnalysis as mda + >>> import pytim + >>> from pytim.datafiles import * + >>> + >>> u = mda.Universe(MICELLE_PDB) + >>> g = u.select_atoms('resname DPC') + >>> inter= pytim.WillardChandler(u, group=g, alpha=3.0, fast=True) + >>> inter.layers + """ - self.layers = None - return None + return self._layers def _sanity_checks(self): """ Basic checks to be performed after the initialization.