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