Skip to content

Commit

Permalink
Merge branch 'issue-599-deprecations' of github.com:MDAnalysis/mdanal…
Browse files Browse the repository at this point in the history
…ysis into issue-599-deprecations
  • Loading branch information
dotsdl committed Mar 30, 2016
2 parents 3e65e1f + abf29ce commit bfc2849
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions package/MDAnalysis/core/AtomGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
def warn_atom_property(func):
warnstring = "In version 0.16.0, use `{}.atoms.{}` instead."

def outfunc(self, *args):
def outfunc(self, *args, **kwargs):
if isinstance(self, SegmentGroup):
warnings.warn(warnstring.format('segmentgroup', func.__name__),
DeprecationWarning)
Expand All @@ -480,7 +480,7 @@ def outfunc(self, *args):
elif isinstance(self, Atom):
pass

return func(self, *args)
return func(self, *args, **kwargs)

return outfunc

Expand Down Expand Up @@ -1651,6 +1651,7 @@ def fragments(self):
"""
return tuple(set(a.fragment for a in self._atoms))

@warn_atom_property
def guess_bonds(self, vdwradii=None):
"""Guess all the bonds that exist within this AtomGroup and add to Universe.
Expand Down Expand Up @@ -1698,6 +1699,7 @@ def guess_bonds(self, vdwradii=None):

@property
@cached('bonds')
@warn_atom_property
def bonds(self):
"""All the bonds in this AtomGroup
Expand All @@ -1715,6 +1717,7 @@ def bonds(self):

@property
@cached('angles')
@warn_atom_property
def angles(self):
"""All the angles in this AtomGroup
Expand All @@ -1732,6 +1735,7 @@ def angles(self):

@property
@cached('dihedrals')
@warn_atom_property
def dihedrals(self):
"""All the dihedrals in this AtomGroup
Expand All @@ -1749,6 +1753,7 @@ def dihedrals(self):

@property
@cached('impropers')
@warn_atom_property
def impropers(self):
"""All the improper dihedrals in this AtomGroup
Expand Down

0 comments on commit bfc2849

Please sign in to comment.