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
b665dfcb
Commit
b665dfcb
authored
Sep 01, 2015
by
peastman
Browse files
Merge pull request #1083 from rmcgibbo/wip-single-23-codebase
Single py2/3 codebase
parents
69a3f678
83d0e5e3
Changes
43
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1180 additions
and
1161 deletions
+1180
-1161
wrappers/python/simtk/openmm/app/internal/customgbforces.py
wrappers/python/simtk/openmm/app/internal/customgbforces.py
+7
-6
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
+1092
-1092
wrappers/python/simtk/openmm/app/internal/pdbx/reader/PdbxContainers.py
...n/simtk/openmm/app/internal/pdbx/reader/PdbxContainers.py
+12
-11
wrappers/python/simtk/openmm/app/internal/pdbx/reader/PdbxParser.py
...ython/simtk/openmm/app/internal/pdbx/reader/PdbxParser.py
+15
-14
wrappers/python/simtk/openmm/app/internal/pdbx/reader/PdbxReadWriteTests.py
...mtk/openmm/app/internal/pdbx/reader/PdbxReadWriteTests.py
+1
-0
wrappers/python/simtk/openmm/app/internal/pdbx/reader/PdbxReader.py
...ython/simtk/openmm/app/internal/pdbx/reader/PdbxReader.py
+15
-14
wrappers/python/simtk/openmm/app/internal/pdbx/reader/PdbxReaderTests.py
.../simtk/openmm/app/internal/pdbx/reader/PdbxReaderTests.py
+1
-0
wrappers/python/simtk/openmm/app/internal/pdbx/writer/PdbxWriter.py
...ython/simtk/openmm/app/internal/pdbx/writer/PdbxWriter.py
+1
-0
wrappers/python/simtk/openmm/app/internal/pdbx/writer/PdbxWriterTests.py
.../simtk/openmm/app/internal/pdbx/writer/PdbxWriterTests.py
+1
-0
wrappers/python/simtk/openmm/app/internal/unitcell.py
wrappers/python/simtk/openmm/app/internal/unitcell.py
+1
-0
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+3
-2
wrappers/python/simtk/openmm/app/pdbreporter.py
wrappers/python/simtk/openmm/app/pdbreporter.py
+1
-0
wrappers/python/simtk/openmm/app/simulation.py
wrappers/python/simtk/openmm/app/simulation.py
+2
-1
wrappers/python/simtk/openmm/app/statedatareporter.py
wrappers/python/simtk/openmm/app/statedatareporter.py
+4
-2
wrappers/python/simtk/openmm/app/topology.py
wrappers/python/simtk/openmm/app/topology.py
+1
-0
wrappers/python/simtk/openmm/mtsintegrator.py
wrappers/python/simtk/openmm/mtsintegrator.py
+1
-0
wrappers/python/simtk/openmm/vec3.py
wrappers/python/simtk/openmm/vec3.py
+1
-0
wrappers/python/simtk/testInstallation.py
wrappers/python/simtk/testInstallation.py
+1
-0
wrappers/python/simtk/unit/__init__.py
wrappers/python/simtk/unit/__init__.py
+18
-17
wrappers/python/simtk/unit/quantity.py
wrappers/python/simtk/unit/quantity.py
+2
-2
No files found.
wrappers/python/simtk/openmm/app/internal/customgbforces.py
View file @
b665dfcb
...
...
@@ -30,6 +30,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from
__future__
import
division
from
__future__
import
absolute_import
from
simtk.openmm
import
CustomGBForce
,
Continuous2DFunction
...
...
@@ -369,13 +370,13 @@ def GBSAGBn2Force(solventDielectric=78.5, soluteDielectric=1, SA=None,
def
convertParameters
(
params
,
gbmodel
):
"""Convert the GB parameters from the file into the values expected by the appropriate CustomGBForce."""
newparams
=
[
None
]
*
len
(
params
)
if
gbmodel
==
'GBn2'
:
offset
=
0.0195141
else
:
offset
=
0.009
for
i
in
range
(
len
(
params
)):
newparams
[
i
]
=
list
(
params
[
i
])
newparams
[
i
][
0
]
-=
offset
newparams
[
i
][
1
]
*=
newparams
[
i
][
0
]
return
newparams
for
p
in
params
:
newParam
=
list
(
p
)
newParam
[
0
]
-=
offset
newParam
[
1
]
*=
newParam
[
0
]
yield
newParam
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
View file @
b665dfcb
#!/bin/env python
"""
pdbstructure.py: Used for managing PDB formated files.
...
...
@@ -30,6 +28,8 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from
__future__
import
absolute_import
from
__future__
import
print_function
__author__
=
"Christopher M. Bruns"
__version__
=
"1.0"
...
...
@@ -37,7 +37,7 @@ __version__ = "1.0"
from
simtk.openmm.vec3
import
Vec3
import
simtk.unit
as
unit
from
..
import
element
from
unitcell
import
computePeriodicBoxVectors
from
.
unitcell
import
computePeriodicBoxVectors
import
warnings
import
sys
import
math
...
...
@@ -212,11 +212,11 @@ class PdbStructure(object):
if
len
(
model
.
chains
)
==
0
:
continue
if
len
(
self
.
models
)
>
1
:
print
>>
output_stream
,
"MODEL %4d"
%
(
model
.
number
)
print
(
"MODEL %4d"
%
(
model
.
number
)
,
file
=
output_stream
)
model
.
write
(
output_stream
)
if
len
(
self
.
models
)
>
1
:
print
>>
output_stream
,
"ENDMDL"
print
>>
output_stream
,
"END"
print
(
"ENDMDL"
,
file
=
output_stream
)
print
(
"END"
,
file
=
output_stream
)
def
_add_model
(
self
,
model
):
if
self
.
default_model
==
None
:
...
...
@@ -451,7 +451,7 @@ class Chain(object):
residue
.
write
(
next_serial_number
,
output_stream
)
if
self
.
has_ter_record
:
r
=
self
.
residues
[
-
1
]
print
>>
output_stream
,
"TER %5d %3s %1s%4d%1s"
%
(
next_serial_number
.
val
,
r
.
name_with_spaces
,
self
.
chain_id
,
r
.
number
,
r
.
insertion_code
)
print
(
"TER %5d %3s %1s%4d%1s"
%
(
next_serial_number
.
val
,
r
.
name_with_spaces
,
self
.
chain_id
,
r
.
number
,
r
.
insertion_code
)
,
file
=
output_stream
)
next_serial_number
.
increment
()
def
_add_ter_record
(
self
):
...
...
@@ -515,7 +515,7 @@ class Residue(object):
"""
"""
alt_loc
=
atom
.
alternate_location_indicator
if
not
self
.
locations
.
has_key
(
alt_loc
):
if
alt_loc
not
in
self
.
locations
:
self
.
locations
[
alt_loc
]
=
Residue
.
Location
(
alt_loc
,
atom
.
residue_name_with_spaces
)
assert
atom
.
residue_number
==
self
.
number
assert
atom
.
insertion_code
==
self
.
insertion_code
...
...
@@ -924,7 +924,7 @@ class Atom(object):
else
:
locs
=
list
(
alt_loc
)
for
loc_id
in
locs
:
print
>>
output_stream
,
self
.
_pdb_string
(
next_serial_number
.
val
,
loc_id
)
print
(
self
.
_pdb_string
(
next_serial_number
.
val
,
loc_id
)
,
file
=
output_stream
)
next_serial_number
.
increment
()
def
set_name_with_spaces
(
self
,
name
):
...
...
@@ -1025,7 +1025,7 @@ if __name__=='__main__':
def
parse_one_pdb
(
pdb_file_name
):
global
atom_count
,
residue_count
,
chain_count
,
model_count
,
structure_count
print
pdb_file_name
print
(
pdb_file_name
)
if
pdb_file_name
[
-
3
:]
==
".gz"
:
fh
=
gzip
.
open
(
pdb_file_name
)
else
:
...
...
@@ -1083,10 +1083,10 @@ if __name__=='__main__':
seconds
=
elapsed
%
60
hours
=
minutes
/
60
minutes
=
minutes
%
60
print
"%dh:%02dm:%02ds elapsed"
%
(
hours
,
minutes
,
seconds
)
print
(
"%dh:%02dm:%02ds elapsed"
%
(
hours
,
minutes
,
seconds
)
)
print
"%d atoms found"
%
atom_count
print
"%d residues found"
%
residue_count
print
"%d chains found"
%
chain_count
print
"%d models found"
%
model_count
print
"%d structures found"
%
structure_count
print
(
"%d atoms found"
%
atom_count
)
print
(
"%d residues found"
%
residue_count
)
print
(
"%d chains found"
%
chain_count
)
print
(
"%d models found"
%
model_count
)
print
(
"%d structures found"
%
structure_count
)
wrappers/python/simtk/openmm/app/internal/pdbx/reader/PdbxContainers.py
View file @
b665dfcb
...
...
@@ -36,6 +36,7 @@ The DataCategory class provides base storage container for instance
data and definition meta data.
"""
from
__future__
import
absolute_import
__docformat__
=
"restructuredtext en"
__author__
=
"John Westbrook"
...
...
@@ -99,13 +100,13 @@ class ContainerBase(object):
self
.
__name
=
name
def
exists
(
self
,
name
):
if
self
.
__objCatalog
.
has_key
(
name
)
:
if
name
in
self
.
__objCatalog
:
return
True
else
:
return
False
def
getObj
(
self
,
name
):
if
self
.
__objCatalog
.
has_key
(
name
)
:
if
name
in
self
.
__objCatalog
:
return
self
.
__objCatalog
[
name
]
else
:
return
None
...
...
@@ -118,7 +119,7 @@ class ContainerBase(object):
of the same name will be overwritten.
"""
if
obj
.
getName
()
is
not
None
:
if
not
self
.
__objCatalog
.
has_key
(
obj
.
getName
())
:
if
obj
.
getName
()
not
in
self
.
__objCatalog
:
# self.__objNameList is keeping track of object order here --
self
.
__objNameList
.
append
(
obj
.
getName
())
self
.
__objCatalog
[
obj
.
getName
()]
=
obj
...
...
@@ -126,7 +127,7 @@ class ContainerBase(object):
def
replace
(
self
,
obj
):
""" Replace an existing object with the input object
"""
if
((
obj
.
getName
()
is
not
None
)
and
(
self
.
__objCatalog
.
has_key
(
obj
.
getName
())
)
):
if
((
obj
.
getName
()
is
not
None
)
and
(
obj
.
getName
()
in
self
.
__objCatalog
)
):
self
.
__objCatalog
[
obj
.
getName
()]
=
obj
...
...
@@ -158,7 +159,7 @@ class ContainerBase(object):
""" Revmove object by name. Return True on success or False otherwise.
"""
try
:
if
self
.
__objCatalog
.
has_key
(
curName
)
:
if
curName
in
self
.
__objCatalog
:
del
self
.
__objCatalog
[
curName
]
i
=
self
.
__objNameList
.
index
(
curName
)
del
self
.
__objNameList
[
i
]
...
...
@@ -217,7 +218,7 @@ class DataContainer(ContainerBase):
def
invokeDataBlockMethod
(
self
,
type
,
method
,
db
):
self
.
__currentRow
=
1
exec
method
.
getInline
()
exec
(
method
.
getInline
()
)
def
setGlobal
(
self
):
self
.
__globalFlag
=
True
...
...
@@ -328,7 +329,7 @@ class DataCategory(DataCategoryBase):
return
self
.
_rowList
[
0
][
ii
]
except
(
IndexError
,
KeyError
):
raise
KeyError
raise
TypeError
,
x
raise
TypeError
(
x
)
def
getCurrentAttribute
(
self
):
...
...
@@ -464,7 +465,7 @@ class DataCategory(DataCategoryBase):
return
self
.
_rowList
[
rowI
][
self
.
_attributeNameList
.
index
(
attribute
)]
except
(
IndexError
):
raise
IndexError
raise
IndexError
,
attribute
raise
IndexError
(
attribute
)
def
setValue
(
self
,
value
,
attributeName
=
None
,
rowIndex
=
None
):
if
attributeName
is
None
:
...
...
@@ -544,13 +545,13 @@ class DataCategory(DataCategoryBase):
if
(
ind
>=
ll
):
row
.
extend
([
None
for
ii
in
xrange
(
2
*
ind
-
ll
)])
row
[
ind
]
=
None
exec
method
.
getInline
()
exec
(
method
.
getInline
()
)
self
.
__currentRowIndex
+=
1
currentRowIndex
=
self
.
__currentRowIndex
def
invokeCategoryMethod
(
self
,
type
,
method
,
db
):
self
.
__currentRowIndex
=
0
exec
method
.
getInline
()
exec
(
method
.
getInline
()
)
def
getAttributeLengthMaximumList
(
self
):
mList
=
[
0
for
i
in
len
(
self
.
_attributeNameList
)]
...
...
@@ -750,7 +751,7 @@ class DataCategory(DataCategoryBase):
except
(
IndexError
):
self
.
__lfh
.
write
(
"attributeName %s rowI %r rowdata %r
\n
"
%
(
attributeName
,
rowI
,
self
.
_rowList
[
rowI
]))
raise
IndexError
raise
TypeError
,
attribute
raise
TypeError
(
attribute
)
def
getValueFormattedByIndex
(
self
,
attributeIndex
,
rowIndex
):
...
...
wrappers/python/simtk/openmm/app/internal/pdbx/reader/PdbxParser.py
View file @
b665dfcb
...
...
@@ -27,6 +27,7 @@ Acknowledgements:
See: http://pymmlib.sourceforge.net/
"""
from
__future__
import
absolute_import
__docformat__
=
"restructuredtext en"
__author__
=
"John Westbrook"
...
...
@@ -137,7 +138,7 @@ class PdbxReader(object):
# Find the first reserved word and begin capturing data.
#
while
True
:
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
if
curWord
is
None
:
continue
reservedWord
,
state
=
self
.
__getState
(
curWord
)
...
...
@@ -194,7 +195,7 @@ class PdbxReader(object):
# Get the data for this attribute from the next token
tCat
,
tAtt
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
tCat
,
tAtt
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
if
tCat
is
not
None
or
(
curQuotedString
is
None
and
curWord
is
None
):
self
.
__syntaxError
(
"Missing data for item _%s.%s"
%
(
curCatName
,
curAttName
))
...
...
@@ -215,7 +216,7 @@ class PdbxReader(object):
else
:
self
.
__syntaxError
(
"Missing value in item-value pair"
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
continue
#
...
...
@@ -225,14 +226,14 @@ class PdbxReader(object):
# The category name in the next curCatName,curAttName pair
# defines the name of the category container.
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
if
curCatName
is
None
or
curAttName
is
None
:
self
.
__syntaxError
(
"Unexpected token in loop_ declaration"
)
return
# Check for a previous category declaration.
if
c
ategoryIndex
.
has_key
(
curCatName
)
:
if
c
urCatName
in
categoryIndex
:
self
.
__syntaxError
(
"Duplicate category declaration in loop_"
)
return
...
...
@@ -248,7 +249,7 @@ class PdbxReader(object):
# Read the rest of the loop_ declaration
while
True
:
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
if
curCatName
is
None
:
break
...
...
@@ -280,7 +281,7 @@ class PdbxReader(object):
elif
curQuotedString
is
not
None
:
curRow
.
append
(
curQuotedString
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
# loop_ data processing ends if -
...
...
@@ -306,7 +307,7 @@ class PdbxReader(object):
categoryIndex
=
{}
curCategory
=
None
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
elif
state
==
"ST_DATA_CONTAINER"
:
#
...
...
@@ -317,7 +318,7 @@ class PdbxReader(object):
containerList
.
append
(
curContainer
)
categoryIndex
=
{}
curCategory
=
None
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
elif
state
==
"ST_STOP"
:
return
...
...
@@ -327,7 +328,7 @@ class PdbxReader(object):
containerList
.
append
(
curContainer
)
categoryIndex
=
{}
curCategory
=
None
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
elif
state
==
"ST_UNKNOWN"
:
self
.
__syntaxError
(
"Unrecogized syntax element: "
+
str
(
curWord
))
...
...
@@ -366,7 +367,7 @@ class PdbxReader(object):
## Tokenizer loop begins here ---
while
True
:
line
=
fileIter
.
next
(
)
line
=
next
(
fileIter
)
self
.
__curLineNumber
+=
1
# Dump comments
...
...
@@ -379,7 +380,7 @@ class PdbxReader(object):
if
line
.
startswith
(
";"
):
mlString
=
[
line
[
1
:]]
while
True
:
line
=
fileIter
.
next
(
)
line
=
next
(
fileIter
)
self
.
__curLineNumber
+=
1
if
line
.
startswith
(
";"
):
break
...
...
@@ -451,7 +452,7 @@ class PdbxReader(object):
## Tokenizer loop begins here ---
while
True
:
line
=
fileIter
.
next
(
)
line
=
next
(
fileIter
)
self
.
__curLineNumber
+=
1
# Dump comments
...
...
@@ -464,7 +465,7 @@ class PdbxReader(object):
if
line
.
startswith
(
";"
):
mlString
=
[
line
[
1
:]]
while
True
:
line
=
fileIter
.
next
(
)
line
=
next
(
fileIter
)
self
.
__curLineNumber
+=
1
if
line
.
startswith
(
";"
):
break
...
...
wrappers/python/simtk/openmm/app/internal/pdbx/reader/PdbxReadWriteTests.py
View file @
b665dfcb
...
...
@@ -10,6 +10,7 @@
##
""" Various tests caess for PDBx/mmCIF data file and dictionary reader and writer.
"""
from
__future__
import
absolute_import
__docformat__
=
"restructuredtext en"
__author__
=
"John Westbrook"
...
...
wrappers/python/simtk/openmm/app/internal/pdbx/reader/PdbxReader.py
View file @
b665dfcb
...
...
@@ -22,6 +22,7 @@ Acknowledgements:
See: http://pymmlib.sourceforge.net/
"""
from
__future__
import
absolute_import
import
re
,
sys
from
simtk.openmm.app.internal.pdbx.reader.PdbxContainers
import
*
...
...
@@ -126,7 +127,7 @@ class PdbxReader(object):
# Find the first reserved word and begin capturing data.
#
while
True
:
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
if
curWord
is
None
:
continue
reservedWord
,
state
=
self
.
__getState
(
curWord
)
...
...
@@ -183,7 +184,7 @@ class PdbxReader(object):
# Get the data for this attribute from the next token
tCat
,
tAtt
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
tCat
,
tAtt
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
if
tCat
is
not
None
or
(
curQuotedString
is
None
and
curWord
is
None
):
self
.
__syntaxError
(
"Missing data for item _%s.%s"
%
(
curCatName
,
curAttName
))
...
...
@@ -204,7 +205,7 @@ class PdbxReader(object):
else
:
self
.
__syntaxError
(
"Missing value in item-value pair"
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
continue
#
...
...
@@ -214,14 +215,14 @@ class PdbxReader(object):
# The category name in the next curCatName,curAttName pair
# defines the name of the category container.
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
if
curCatName
is
None
or
curAttName
is
None
:
self
.
__syntaxError
(
"Unexpected token in loop_ declaration"
)
return
# Check for a previous category declaration.
if
c
ategoryIndex
.
has_key
(
curCatName
)
:
if
c
urCatName
in
categoryIndex
:
self
.
__syntaxError
(
"Duplicate category declaration in loop_"
)
return
...
...
@@ -237,7 +238,7 @@ class PdbxReader(object):
# Read the rest of the loop_ declaration
while
True
:
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
if
curCatName
is
None
:
break
...
...
@@ -269,7 +270,7 @@ class PdbxReader(object):
elif
curQuotedString
is
not
None
:
curRow
.
append
(
curQuotedString
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
# loop_ data processing ends if -
...
...
@@ -295,7 +296,7 @@ class PdbxReader(object):
categoryIndex
=
{}
curCategory
=
None
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
elif
state
==
"ST_DATA_CONTAINER"
:
#
...
...
@@ -306,7 +307,7 @@ class PdbxReader(object):
containerList
.
append
(
curContainer
)
categoryIndex
=
{}
curCategory
=
None
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
elif
state
==
"ST_STOP"
:
return
...
...
@@ -316,7 +317,7 @@ class PdbxReader(object):
containerList
.
append
(
curContainer
)
categoryIndex
=
{}
curCategory
=
None
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
tokenizer
.
next
(
)
curCatName
,
curAttName
,
curQuotedString
,
curWord
=
next
(
tokenizer
)
elif
state
==
"ST_UNKNOWN"
:
self
.
__syntaxError
(
"Unrecogized syntax element: "
+
str
(
curWord
))
...
...
@@ -355,7 +356,7 @@ class PdbxReader(object):
## Tokenizer loop begins here ---
while
True
:
line
=
fileIter
.
next
(
)
line
=
next
(
fileIter
)
self
.
__curLineNumber
+=
1
# Dump comments
...
...
@@ -368,7 +369,7 @@ class PdbxReader(object):
if
line
.
startswith
(
";"
):
mlString
=
[
line
[
1
:]]
while
True
:
line
=
fileIter
.
next
(
)
line
=
next
(
fileIter
)
self
.
__curLineNumber
+=
1
if
line
.
startswith
(
";"
):
break
...
...
@@ -426,7 +427,7 @@ class PdbxReader(object):
## Tokenizer loop begins here ---
while
True
:
line
=
fileIter
.
next
(
)
line
=
next
(
fileIter
)
self
.
__curLineNumber
+=
1
# Dump comments
...
...
@@ -439,7 +440,7 @@ class PdbxReader(object):
if
line
.
startswith
(
";"
):
mlString
=
[
line
[
1
:]]
while
True
:
line
=
fileIter
.
next
(
)
line
=
next
(
fileIter
)
self
.
__curLineNumber
+=
1
if
line
.
startswith
(
";"
):
break
...
...
wrappers/python/simtk/openmm/app/internal/pdbx/reader/PdbxReaderTests.py
View file @
b665dfcb
...
...
@@ -12,6 +12,7 @@
Test cases for reading PDBx/mmCIF data files PdbxReader class -
"""
from
__future__
import
absolute_import
import
sys
,
unittest
,
traceback
import
sys
,
time
,
os
,
os
.
path
,
shutil
...
...
wrappers/python/simtk/openmm/app/internal/pdbx/writer/PdbxWriter.py
View file @
b665dfcb
...
...
@@ -11,6 +11,7 @@
Classes for writing data and dictionary containers in PDBx/mmCIF format.
"""
from
__future__
import
absolute_import
__docformat__
=
"restructuredtext en"
__author__
=
"John Westbrook"
__email__
=
"jwest@rcsb.rutgers.edu"
...
...
wrappers/python/simtk/openmm/app/internal/pdbx/writer/PdbxWriterTests.py
View file @
b665dfcb
...
...
@@ -12,6 +12,7 @@
Test implementing PDBx/mmCIF write and formatting operations.
"""
from
__future__
import
absolute_import
__docformat__
=
"restructuredtext en"
__author__
=
"John Westbrook"
__email__
=
"jwest@rcsb.rutgers.edu"
...
...
wrappers/python/simtk/openmm/app/internal/unitcell.py
View file @
b665dfcb
...
...
@@ -28,6 +28,7 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from
__future__
import
absolute_import
__author__
=
"Peter Eastman"
__version__
=
"1.0"
...
...
wrappers/python/simtk/openmm/app/modeller.py
View file @
b665dfcb
...
...
@@ -29,6 +29,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from
__future__
import
division
from
__future__
import
absolute_import
__author__
=
"Peter Eastman"
__version__
=
"1.0"
...
...
@@ -40,7 +41,7 @@ from simtk.openmm.vec3 import Vec3
from
simtk.openmm
import
System
,
Context
,
NonbondedForce
,
CustomNonbondedForce
,
HarmonicBondForce
,
HarmonicAngleForce
,
VerletIntegrator
,
LocalEnergyMinimizer
from
simtk.unit
import
nanometer
,
molar
,
elementary_charge
,
amu
,
gram
,
liter
,
degree
,
sqrt
,
acos
,
is_quantity
,
dot
,
norm
import
simtk.unit
as
unit
import
element
as
elem
from
.
import
element
as
elem
import
os
import
random
import
xml.etree.ElementTree
as
etree
...
...
@@ -877,7 +878,7 @@ class Modeller(object):
# Create copies of all residue templates that have had all extra points removed.
templatesNoEP
=
{}
for
resName
,
template
in
forcefield
.
_templates
.
iter
items
():
for
resName
,
template
in
forcefield
.
_templates
.
items
():
if
any
(
atom
.
element
is
None
for
atom
in
template
.
atoms
):
index
=
0
newIndex
=
{}
...
...
wrappers/python/simtk/openmm/app/pdbreporter.py
View file @
b665dfcb
...
...
@@ -28,6 +28,7 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from
__future__
import
absolute_import
__author__
=
"Peter Eastman"
__version__
=
"1.0"
...
...
wrappers/python/simtk/openmm/app/simulation.py
View file @
b665dfcb
...
...
@@ -28,6 +28,7 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from
__future__
import
absolute_import
__author__
=
"Peter Eastman"
__version__
=
"1.0"
...
...
@@ -133,7 +134,7 @@ class Simulation(object):
def
_simulate
(
self
,
endStep
=
None
,
endTime
=
None
):
if
endStep
is
None
:
endStep
=
sys
.
max
int
endStep
=
sys
.
max
size
nextReport
=
[
None
]
*
len
(
self
.
reporters
)
while
self
.
currentStep
<
endStep
and
(
endTime
is
None
or
datetime
.
now
()
<
endTime
):
nextSteps
=
endStep
-
self
.
currentStep
...
...
wrappers/python/simtk/openmm/app/statedatareporter.py
View file @
b665dfcb
...
...
@@ -28,6 +28,8 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from
__future__
import
absolute_import
from
__future__
import
print_function
__author__
=
"Peter Eastman"
__version__
=
"1.0"
...
...
@@ -146,7 +148,7 @@ class StateDataReporter(object):
if
not
self
.
_hasInitialized
:
self
.
_initializeConstants
(
simulation
)
headers
=
self
.
_constructHeaders
()
print
>>
self
.
_out
,
'#"%s"'
%
(
'"'
+
self
.
_separator
+
'"'
).
join
(
headers
)
print
(
'#"%s"'
%
(
'"'
+
self
.
_separator
+
'"'
).
join
(
headers
)
,
file
=
self
.
_out
)
try
:
self
.
_out
.
flush
()
except
AttributeError
:
...
...
@@ -163,7 +165,7 @@ class StateDataReporter(object):
values
=
self
.
_constructReportValues
(
simulation
,
state
)
# Write the values.
print
>>
self
.
_out
,
self
.
_separator
.
join
(
str
(
v
)
for
v
in
values
)
print
(
self
.
_separator
.
join
(
str
(
v
)
for
v
in
values
)
,
file
=
self
.
_out
)
try
:
self
.
_out
.
flush
()
except
AttributeError
:
...
...
wrappers/python/simtk/openmm/app/topology.py
View file @
b665dfcb
...
...
@@ -28,6 +28,7 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from
__future__
import
absolute_import
__author__
=
"Peter Eastman"
__version__
=
"1.0"
...
...
wrappers/python/simtk/openmm/mtsintegrator.py
View file @
b665dfcb
...
...
@@ -28,6 +28,7 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from
__future__
import
absolute_import
__author__
=
"Peter Eastman"
__version__
=
"1.0"
...
...
wrappers/python/simtk/openmm/vec3.py
View file @
b665dfcb
...
...
@@ -28,6 +28,7 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
from
__future__
import
absolute_import
__author__
=
"Peter Eastman"
__version__
=
"1.0"
...
...
wrappers/python/simtk/testInstallation.py
View file @
b665dfcb
from
__future__
import
print_function
from
__future__
import
absolute_import
from
functools
import
wraps
import
os
import
sys
...
...
wrappers/python/simtk/unit/__init__.py
View file @
b665dfcb
"""
Physical quantities with units for dimensional analysis and automatic unit conversion.
"""
__docformat__
=
"epytext en"
from
__future__
import
absolute_import
__docformat__
=
"epytext en"
__author__
=
"Christopher M. Bruns"
__copyright__
=
"Copyright 2010, Stanford University and Christopher M. Bruns"
__credits__
=
[]
...
...
@@ -10,8 +11,8 @@ __license__ = "MIT"
__maintainer__
=
"Christopher M. Bruns"
__email__
=
"cmbruns@stanford.edu"
from
unit
import
Unit
,
is_unit
from
quantity
import
Quantity
,
is_quantity
from
unit_math
import
*
from
unit_definitions
import
*
from
constants
import
*
from
.
unit
import
Unit
,
is_unit
from
.
quantity
import
Quantity
,
is_quantity
from
.
unit_math
import
*
from
.
unit_definitions
import
*
from
.
constants
import
*
wrappers/python/simtk/unit/quantity.py
View file @
b665dfcb
...
...
@@ -807,8 +807,8 @@ def _is_string(x):
if
isinstance
(
x
,
str
):
return
True
try
:
first_item
=
iter
(
x
)
.
next
(
)
inner_item
=
iter
(
first_item
)
.
next
(
)
first_item
=
next
(
iter
(
x
))
inner_item
=
next
(
iter
(
first_item
))
if
first_item
is
inner_item
:
return
True
else
:
...
...
Prev
1
2
3
Next
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