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
e62739d2
Commit
e62739d2
authored
Jul 08, 2014
by
peastman
Browse files
Merge pull request #507 from swails/minor_fixes
Small fixes:
parents
0ccc5c9e
11877204
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
wrappers/python/simtk/openmm/app/charmmpsffile.py
wrappers/python/simtk/openmm/app/charmmpsffile.py
+16
-7
wrappers/python/simtk/openmm/app/element.py
wrappers/python/simtk/openmm/app/element.py
+0
-2
wrappers/python/simtk/openmm/app/internal/charmm/topologyobjects.py
...ython/simtk/openmm/app/internal/charmm/topologyobjects.py
+2
-2
No files found.
wrappers/python/simtk/openmm/app/charmmpsffile.py
View file @
e62739d2
...
@@ -158,10 +158,13 @@ class CharmmPsfFile(object):
...
@@ -158,10 +158,13 @@ class CharmmPsfFile(object):
title
=
list
()
title
=
list
()
for
i
in
range
(
ntitle
):
for
i
in
range
(
ntitle
):
title
.
append
(
psf
.
readline
().
rstrip
())
title
.
append
(
psf
.
readline
().
rstrip
())
# Skip the blank line
# Skip all blank lines. Most of the time there is only 1, but I've seen
psf
.
readline
()
# a file that has 2
line
=
psf
.
readline
().
strip
()
while
not
line
:
line
=
psf
.
readline
().
strip
()
# Next is the number of atoms
# Next is the number of atoms
natom
=
conv
(
psf
.
readline
().
strip
()
,
int
,
'natom'
)
natom
=
conv
(
line
,
int
,
'natom'
)
# Parse all of the atoms
# Parse all of the atoms
residue_list
=
ResidueList
()
residue_list
=
ResidueList
()
atom_list
=
AtomList
()
atom_list
=
AtomList
()
...
@@ -1182,6 +1185,9 @@ class CharmmPsfFile(object):
...
@@ -1182,6 +1185,9 @@ class CharmmPsfFile(object):
if
switchDistance
>=
nonbondedCutoff
:
if
switchDistance
>=
nonbondedCutoff
:
raise
ValueError
(
'switchDistance is too large compared '
raise
ValueError
(
'switchDistance is too large compared '
'to the cutoff!'
)
'to the cutoff!'
)
if
abs
(
switchDistance
)
!=
switchDistance
:
# Detects negatives for both Quantity and float
raise
ValueError
(
'switchDistance must be non-negative!'
)
force
.
setUseSwitchingFunction
(
True
)
force
.
setUseSwitchingFunction
(
True
)
force
.
setSwitchingDistance
(
switchDistance
)
force
.
setSwitchingDistance
(
switchDistance
)
...
@@ -1223,6 +1229,9 @@ class CharmmPsfFile(object):
...
@@ -1223,6 +1229,9 @@ class CharmmPsfFile(object):
if
switchDistance
>=
nonbondedCutoff
:
if
switchDistance
>=
nonbondedCutoff
:
raise
ValueError
(
'switchDistance is too large compared '
raise
ValueError
(
'switchDistance is too large compared '
'to the cutoff!'
)
'to the cutoff!'
)
if
abs
(
switchDistance
)
!=
switchDistance
:
# Detects negatives for both Quantity and float
raise
ValueError
(
'switchDistance must be non-negative!'
)
force
.
setUseSwitchingFunction
(
True
)
force
.
setUseSwitchingFunction
(
True
)
force
.
setSwitchingDistance
(
switchDistance
)
force
.
setSwitchingDistance
(
switchDistance
)
...
...
wrappers/python/simtk/openmm/app/element.py
100755 → 100644
View file @
e62739d2
#!/bin/env python
"""
"""
element.py: Used for managing elements.
element.py: Used for managing elements.
...
...
wrappers/python/simtk/openmm/app/internal/charmm/topologyobjects.py
View file @
e62739d2
...
@@ -12,7 +12,7 @@ Copyright (c) 2014 the Authors
...
@@ -12,7 +12,7 @@ Copyright (c) 2014 the Authors
Author: Jason M. Swails
Author: Jason M. Swails
Contributors:
Contributors:
Date:
April 18
, 2014
Date:
July 3
, 2014
Permission is hereby granted, free of charge, to any person obtaining a
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
copy of this software and associated documentation files (the "Software"),
...
@@ -501,7 +501,7 @@ class Angle(object):
...
@@ -501,7 +501,7 @@ class Angle(object):
""" See if a bond or an atom is in this angle """
""" See if a bond or an atom is in this angle """
if
isinstance
(
thing
,
Bond
):
if
isinstance
(
thing
,
Bond
):
return
self
.
atom2
in
thing
and
(
self
.
atom1
in
thing
or
return
self
.
atom2
in
thing
and
(
self
.
atom1
in
thing
or
self
.
atom
2
in
thing
)
self
.
atom
3
in
thing
)
# Otherwise assume it's an atom
# Otherwise assume it's an atom
return
self
.
atom1
is
thing
or
self
.
atom2
is
thing
or
self
.
atom3
is
thing
return
self
.
atom1
is
thing
or
self
.
atom2
is
thing
or
self
.
atom3
is
thing
...
...
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