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
3d863037
Commit
3d863037
authored
May 26, 2015
by
peastman
Browse files
Merge pull request #930 from swails/gmx_virtualsites
Raise exception when processing Gromacs molecule with virtual sites
parents
51b7141a
e04283bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
wrappers/python/simtk/openmm/app/gromacstopfile.py
wrappers/python/simtk/openmm/app/gromacstopfile.py
+8
-0
No files found.
wrappers/python/simtk/openmm/app/gromacstopfile.py
View file @
3d863037
...
@@ -114,6 +114,7 @@ class GromacsTopFile(object):
...
@@ -114,6 +114,7 @@ class GromacsTopFile(object):
self
.
exclusions
=
[]
self
.
exclusions
=
[]
self
.
pairs
=
[]
self
.
pairs
=
[]
self
.
cmaps
=
[]
self
.
cmaps
=
[]
self
.
has_virtual_sites
=
False
def
_processFile
(
self
,
file
):
def
_processFile
(
self
,
file
):
append
=
''
append
=
''
...
@@ -247,6 +248,11 @@ class GromacsTopFile(object):
...
@@ -247,6 +248,11 @@ class GromacsTopFile(object):
self
.
_processPairType
(
line
)
self
.
_processPairType
(
line
)
elif
self
.
_currentCategory
==
'cmaptypes'
:
elif
self
.
_currentCategory
==
'cmaptypes'
:
self
.
_processCmapType
(
line
)
self
.
_processCmapType
(
line
)
elif
self
.
_currentCategory
.
startswith
(
'virtual_sites'
):
if
self
.
_currentMoleculeType
is
None
:
raise
ValueError
(
'Found %s before [ moleculetype ]'
%
self
.
_currentCategory
)
self
.
_currentMoleculeType
.
has_virtual_sites
=
True
def
_processDefaults
(
self
,
line
):
def
_processDefaults
(
self
,
line
):
"""Process the [ defaults ] line."""
"""Process the [ defaults ] line."""
...
@@ -483,6 +489,8 @@ class GromacsTopFile(object):
...
@@ -483,6 +489,8 @@ class GromacsTopFile(object):
if
moleculeName
not
in
self
.
_moleculeTypes
:
if
moleculeName
not
in
self
.
_moleculeTypes
:
raise
ValueError
(
"Unknown molecule type: "
+
moleculeName
)
raise
ValueError
(
"Unknown molecule type: "
+
moleculeName
)
moleculeType
=
self
.
_moleculeTypes
[
moleculeName
]
moleculeType
=
self
.
_moleculeTypes
[
moleculeName
]
if
moleculeCount
>
0
and
moleculeType
.
has_virtual_sites
:
raise
ValueError
(
'Virtual sites not yet supported by Gromacs parsers'
)
# Create the specified number of molecules of this type.
# Create the specified number of molecules of this type.
...
...
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