Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
3c328f39
Commit
3c328f39
authored
May 04, 2015
by
peastman
Browse files
Merge pull request #892 from swails/catch_chamber
Better error catch for using chamber prmtops
parents
7b67c27b
486b97c7
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6773 additions
and
1 deletion
+6773
-1
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
...ers/python/simtk/openmm/app/internal/amber_file_parser.py
+4
-0
wrappers/python/tests/TestAmberPrmtopFile.py
wrappers/python/tests/TestAmberPrmtopFile.py
+11
-1
wrappers/python/tests/systems/ala3_solv.parm7
wrappers/python/tests/systems/ala3_solv.parm7
+6758
-0
No files found.
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
View file @
3c328f39
...
@@ -127,6 +127,10 @@ class PrmtopLoader(object):
...
@@ -127,6 +127,10 @@ class PrmtopLoader(object):
tag
,
self
.
_prmtopVersion
=
line
.
rstrip
().
split
(
None
,
1
)
tag
,
self
.
_prmtopVersion
=
line
.
rstrip
().
split
(
None
,
1
)
elif
line
.
startswith
(
'%FLAG'
):
elif
line
.
startswith
(
'%FLAG'
):
tag
,
flag
=
line
.
rstrip
().
split
(
None
,
1
)
tag
,
flag
=
line
.
rstrip
().
split
(
None
,
1
)
if
flag
==
'CTITLE'
:
raise
TypeError
(
'CHAMBER-style topology files are not supported here. '
'Consider using the CHARMM files directly with CharmmPsfFile '
'or ParmEd (where CHAMBER topologies are supported)'
)
self
.
_flags
.
append
(
flag
)
self
.
_flags
.
append
(
flag
)
self
.
_raw_data
[
flag
]
=
[]
self
.
_raw_data
[
flag
]
=
[]
elif
line
.
startswith
(
'%FORMAT'
):
elif
line
.
startswith
(
'%FORMAT'
):
...
...
wrappers/python/tests/TestAmberPrmtopFile.py
View file @
3c328f39
...
@@ -316,7 +316,17 @@ class TestAmberPrmtopFile(unittest.TestCase):
...
@@ -316,7 +316,17 @@ class TestAmberPrmtopFile(unittest.TestCase):
simulation
.
reporters
.
append
(
DCDReporter
(
fname
,
1
))
# This is an explicit test for the bugs in issue #850
simulation
.
reporters
.
append
(
DCDReporter
(
fname
,
1
))
# This is an explicit test for the bugs in issue #850
simulation
.
step
(
5
)
simulation
.
step
(
5
)
os
.
remove
(
fname
)
os
.
remove
(
fname
)
def
testChamber
(
self
):
""" Tests that Chamber prmtops fail with proper error message """
self
.
assertRaises
(
TypeError
,
lambda
:
AmberPrmtopFile
(
'systems/ala3_solv.parm7'
))
try
:
parm
=
AmberPrmtopFile
(
'systems/ala3_solv.parm7'
)
# Should not make it past here
self
.
assertTrue
(
False
)
except
TypeError
as
e
:
# Make sure it says something about chamber
self
.
assertTrue
(
'chamber'
in
str
(
e
).
lower
())
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
wrappers/python/tests/systems/ala3_solv.parm7
0 → 100644
View file @
3c328f39
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment