"wrappers/python/vscode:/vscode.git/clone" did not exist on "09611266c8a1fd0f90ec0926d7e65fddc3ebeaec"
Commit 10d3930b authored by peastman's avatar peastman
Browse files

Merge pull request #598 from swails/improve_warnings

Improve warning messages coming from the CHARMM parsers.
parents e2c272d0 263c1d75
......@@ -341,9 +341,10 @@ class CharmmParameterSet(object):
replaced = False
for i, dtype in enumerate(self.dihedral_types[key]):
if dtype.per == dihedral.per:
# Replace. Should we warn here?
warnings.warn('Replacing dihedral %r with %r' %
(dtype, dihedral))
# Replace. Warn if they are different
if dtype != dihedral:
warnings.warn('Replacing dihedral %r with %r' %
(dtype, dihedral))
self.dihedral_types[key]
replaced = True
break
......
......@@ -926,6 +926,10 @@ class DihedralType(object):
self.per = int(per)
self.phase = float(phase)
def __repr__(self):
return "<DihedralType: k=%s; phase=%s; per=%s>" % (self.phi_k,
self.phase, self.per)
def __eq__(self, other):
return (self.phi_k == other.phi_k and self.per == other.per and
self.phase == other.phase)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment