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
4fa7e25d
Commit
4fa7e25d
authored
Jun 25, 2020
by
Charlles Abreu
Browse files
Safer periodic attribute reading in ForceField
parent
2507ee7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+5
-1
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
4fa7e25d
...
...
@@ -87,7 +87,11 @@ def _parseFunctions(element):
elif
key
.
endswith
(
'min'
)
or
key
.
endswith
(
'max'
):
params
[
key
]
=
float
(
function
.
attrib
[
key
])
if
functionType
.
startswith
(
'Continuous'
):
params
[
'periodic'
]
=
eval
(
function
.
attrib
.
get
(
'periodic'
,
'False'
).
title
())
periodicStr
=
function
.
attrib
.
get
(
'periodic'
,
'false'
).
lower
()
if
periodicStr
in
[
'true'
,
'false'
,
'yes'
,
'no'
,
'1'
,
'0'
]:
params
[
'periodic'
]
=
periodicStr
in
[
'true'
,
'yes'
,
'1'
]
else
:
raise
ValueError
(
'ForceField: non-boolean value for periodic attribute in tabulated function definition'
)
functions
.
append
((
function
.
attrib
[
'name'
],
functionType
,
values
,
params
))
return
functions
...
...
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