Commit 42c3cc03 authored by Jason Swails's avatar Jason Swails
Browse files

Add a check and raise an exception if someone tries to use a CHAMBER-style

topology file with the Amber file parsers. These do *not* currently work for
creating a system.
parent 19ccd0f8
......@@ -173,6 +173,10 @@ class AmberPrmtopFile(object):
- ewaldErrorTolerance (float=0.0005) The error tolerance to use if nonbondedMethod is Ewald or PME.
Returns: the newly created System
"""
if self._prmtop.chamber:
raise ValueError("CHAMBER-style topology file detected. CHAMBER "
"topologies are not supported -- use the native "
"CHARMM files directly.")
methodMap = {ff.NoCutoff:'NoCutoff',
ff.CutoffNonPeriodic:'CutoffNonPeriodic',
ff.CutoffPeriodic:'CutoffPeriodic',
......
......@@ -119,7 +119,7 @@ class PrmtopLoader(object):
self._raw_data={}
self._has_nbfix_terms = False
fIn=open(inFilename)
with open(inFilename, 'r') as fIn:
for line in fIn:
if line.startswith('%VERSION'):
tag, self._prmtopVersion = line.rstrip().split(None, 1)
......@@ -148,7 +148,9 @@ class PrmtopLoader(object):
item = line[index:index+iLength]
if item:
self._raw_data[flag].append(item.strip())
fIn.close()
# See if this is a CHAMBER-style topology file, which is not supported
# for creating Systems
self.chamber = 'CTITLE' in self._flags
def _getFormat(self, flag=None):
if not flag:
......
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