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
452506eb
Unverified
Commit
452506eb
authored
Feb 19, 2025
by
Peter Eastman
Committed by
GitHub
Feb 19, 2025
Browse files
Fixed backslashes that were improperly interpreted as escapes (#4804)
parent
cd8f19c5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
29 deletions
+29
-29
wrappers/python/openmm/__init__.py
wrappers/python/openmm/__init__.py
+1
-1
wrappers/python/openmm/app/gromacsgrofile.py
wrappers/python/openmm/app/gromacsgrofile.py
+1
-1
wrappers/python/openmm/app/internal/amber_file_parser.py
wrappers/python/openmm/app/internal/amber_file_parser.py
+1
-1
wrappers/python/openmm/app/internal/pdbstructure.py
wrappers/python/openmm/app/internal/pdbstructure.py
+2
-2
wrappers/python/openmm/app/internal/pdbx/reader/PdbxParser.py
...pers/python/openmm/app/internal/pdbx/reader/PdbxParser.py
+11
-11
wrappers/python/openmm/app/internal/pdbx/reader/PdbxReader.py
...pers/python/openmm/app/internal/pdbx/reader/PdbxReader.py
+11
-11
wrappers/python/openmm/app/metadynamics.py
wrappers/python/openmm/app/metadynamics.py
+1
-1
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
+1
-1
No files found.
wrappers/python/openmm/__init__.py
View file @
452506eb
...
@@ -13,7 +13,7 @@ from . import version
...
@@ -13,7 +13,7 @@ from . import version
if
sys
.
platform
==
'win32'
:
if
sys
.
platform
==
'win32'
:
_path
=
os
.
environ
[
'PATH'
]
_path
=
os
.
environ
[
'PATH'
]
os
.
environ
[
'PATH'
]
=
'%(lib)s;%(lib)s\plugins;%(path)s'
%
{
os
.
environ
[
'PATH'
]
=
r
'%(lib)s;%(lib)s\plugins;%(path)s'
%
{
'lib'
:
version
.
openmm_library_path
,
'path'
:
_path
}
'lib'
:
version
.
openmm_library_path
,
'path'
:
_path
}
try
:
try
:
with
os
.
add_dll_directory
(
version
.
openmm_library_path
):
with
os
.
add_dll_directory
(
version
.
openmm_library_path
):
...
...
wrappers/python/openmm/app/gromacsgrofile.py
View file @
452506eb
...
@@ -59,7 +59,7 @@ def _isfloat(word):
...
@@ -59,7 +59,7 @@ def _isfloat(word):
@return answer Boolean which specifies whether the string is any number
@return answer Boolean which specifies whether the string is any number
"""
"""
return
match
(
'^[-+]?[0-9]*\.?[0-9]*([eEdD][-+]?[0-9]+)?$'
,
word
)
return
match
(
r
'^[-+]?[0-9]*\.?[0-9]*([eEdD][-+]?[0-9]+)?$'
,
word
)
def
_is_gro_coord
(
line
):
def
_is_gro_coord
(
line
):
""" Determines whether a line contains GROMACS data or not
""" Determines whether a line contains GROMACS data or not
...
...
wrappers/python/openmm/app/internal/amber_file_parser.py
View file @
452506eb
...
@@ -62,7 +62,7 @@ from . import customgbforces as customgb
...
@@ -62,7 +62,7 @@ from . import customgbforces as customgb
#=============================================================================================
#=============================================================================================
# A regex for extracting print format info from the FORMAT lines.
# A regex for extracting print format info from the FORMAT lines.
FORMAT_RE_PATTERN
=
re
.
compile
(
"([0-9]+)\(?([a-zA-Z]+)([0-9]+)\.?([0-9]*)\)?"
)
FORMAT_RE_PATTERN
=
re
.
compile
(
r
"([0-9]+)\(?([a-zA-Z]+)([0-9]+)\.?([0-9]*)\)?"
)
# Pointer labels which map to pointer numbers at top of prmtop files
# Pointer labels which map to pointer numbers at top of prmtop files
POINTER_LABELS
=
"""
POINTER_LABELS
=
"""
...
...
wrappers/python/openmm/app/internal/pdbstructure.py
View file @
452506eb
...
@@ -1075,7 +1075,7 @@ if __name__=='__main__':
...
@@ -1075,7 +1075,7 @@ if __name__=='__main__':
subdir
=
"ae"
subdir
=
"ae"
full_subdir
=
os
.
path
.
join
(
pdb_dir
,
subdir
)
full_subdir
=
os
.
path
.
join
(
pdb_dir
,
subdir
)
for
pdb_file
in
os
.
listdir
(
full_subdir
):
for
pdb_file
in
os
.
listdir
(
full_subdir
):
if
not
re
.
match
(
"pdb.%2s.\.ent\.gz"
%
subdir
,
pdb_file
):
if
not
re
.
match
(
r
"pdb.%2s.\.ent\.gz"
%
subdir
,
pdb_file
):
continue
continue
full_pdb_file
=
os
.
path
.
join
(
full_subdir
,
pdb_file
)
full_pdb_file
=
os
.
path
.
join
(
full_subdir
,
pdb_file
)
parse_one_pdb
(
full_pdb_file
)
parse_one_pdb
(
full_pdb_file
)
...
@@ -1086,7 +1086,7 @@ if __name__=='__main__':
...
@@ -1086,7 +1086,7 @@ if __name__=='__main__':
if
not
os
.
path
.
isdir
(
full_subdir
):
if
not
os
.
path
.
isdir
(
full_subdir
):
continue
continue
for
pdb_file
in
os
.
listdir
(
full_subdir
):
for
pdb_file
in
os
.
listdir
(
full_subdir
):
if
not
re
.
match
(
"pdb.%2s.\.ent\.gz"
%
subdir
,
pdb_file
):
if
not
re
.
match
(
r
"pdb.%2s.\.ent\.gz"
%
subdir
,
pdb_file
):
continue
continue
full_pdb_file
=
os
.
path
.
join
(
full_subdir
,
pdb_file
)
full_pdb_file
=
os
.
path
.
join
(
full_subdir
,
pdb_file
)
parse_one_pdb
(
full_pdb_file
)
parse_one_pdb
(
full_pdb_file
)
...
...
wrappers/python/openmm/app/internal/pdbx/reader/PdbxParser.py
View file @
452506eb
...
@@ -355,16 +355,16 @@ class PdbxReader(object):
...
@@ -355,16 +355,16 @@ class PdbxReader(object):
mmcifRe
=
re
.
compile
(
mmcifRe
=
re
.
compile
(
r
"(?:"
r
"(?:"
"(?:_(.+?)[.](\S+))"
"|"
# _category.attribute
r
"(?:_(.+?)[.](\S+))"
"|"
# _category.attribute
"(?:['](.*?)(?:[']\s|[']$))"
"|"
# single quoted strings
r
"(?:['](.*?)(?:[']\s|[']$))"
"|"
# single quoted strings
"(?:[
\"
](.*?)(?:[
\"
]\s|[
\"
]$))"
"|"
# double quoted strings
r
"(?:[\"](.*?)(?:[\"]\s|[\"]$))"
"|"
# double quoted strings
"(?:\s*#.*$)"
"|"
# comments (dumped)
r
"(?:\s*#.*$)"
"|"
# comments (dumped)
"(\S+)"
# unquoted words
r
"(\S+)"
# unquoted words
")"
)
r
")"
)
fileIter
=
iter
(
ifh
)
fileIter
=
iter
(
ifh
)
...
@@ -423,15 +423,15 @@ class PdbxReader(object):
...
@@ -423,15 +423,15 @@ class PdbxReader(object):
mmcifRe = re.compile(
mmcifRe = re.compile(
r"(?:"
r"(?:"
"(?:_(.+?)[.](\S+))" "|" # _category.attribute
r
"(?:_(.+?)[.](\S+))" "|" # _category.attribute
"(?:['
\"
](.*?)(?:['
\"
]\s|['
\"
]$))" "|" # quoted strings
r
"(?:['
\"
](.*?)(?:['
\"
]\s|['
\"
]$))" "|" # quoted strings
"(?:\s*#.*$)" "|" # comments (dumped)
r
"(?:\s*#.*$)" "|" # comments (dumped)
"(\S+)" # unquoted words
r
"(\S+)" # unquoted words
")")
r
")")
"""
"""
...
...
wrappers/python/openmm/app/internal/pdbx/reader/PdbxReader.py
View file @
452506eb
...
@@ -344,16 +344,16 @@ class PdbxReader(object):
...
@@ -344,16 +344,16 @@ class PdbxReader(object):
mmcifRe
=
re
.
compile
(
mmcifRe
=
re
.
compile
(
r
"(?:"
r
"(?:"
"(?:_(.+?)[.](\S+))"
"|"
# _category.attribute
r
"(?:_(.+?)[.](\S+))"
"|"
# _category.attribute
"(?:['](.*?)(?:[']\s|[']$))"
"|"
# single quoted strings
r
"(?:['](.*?)(?:[']\s|[']$))"
"|"
# single quoted strings
"(?:[
\"
](.*?)(?:[
\"
]\s|[
\"
]$))"
"|"
# double quoted strings
r
"(?:[\"](.*?)(?:[\"]\s|[\"]$))"
"|"
# double quoted strings
"(?:\s*#.*$)"
"|"
# comments (dumped)
r
"(?:\s*#.*$)"
"|"
# comments (dumped)
"(\S+)"
# unquoted words
r
"(\S+)"
# unquoted words
")"
)
r
")"
)
fileIter
=
iter
(
ifh
)
fileIter
=
iter
(
ifh
)
...
@@ -416,15 +416,15 @@ class PdbxReader(object):
...
@@ -416,15 +416,15 @@ class PdbxReader(object):
mmcifRe
=
re
.
compile
(
mmcifRe
=
re
.
compile
(
r
"(?:"
r
"(?:"
"(?:_(.+?)[.](\S+))"
"|"
# _category.attribute
r
"(?:_(.+?)[.](\S+))"
"|"
# _category.attribute
"(?:['
\"
](.*?)(?:['
\"
]\s|['
\"
]$))"
"|"
# quoted strings
r
"(?:['\"](.*?)(?:['\"]\s|['\"]$))"
"|"
# quoted strings
"(?:\s*#.*$)"
"|"
# comments (dumped)
r
"(?:\s*#.*$)"
"|"
# comments (dumped)
"(\S+)"
# unquoted words
r
"(\S+)"
# unquoted words
")"
)
r
")"
)
fileIter
=
iter
(
ifh
)
fileIter
=
iter
(
ifh
)
...
...
wrappers/python/openmm/app/metadynamics.py
View file @
452506eb
...
@@ -244,7 +244,7 @@ class Metadynamics(object):
...
@@ -244,7 +244,7 @@ class Metadynamics(object):
# Check for any files updated by other processes.
# Check for any files updated by other processes.
fileLoaded
=
False
fileLoaded
=
False
pattern
=
re
.
compile
(
'bias_(.*)_(.*)\.npy'
)
pattern
=
re
.
compile
(
r
'bias_(.*)_(.*)\.npy'
)
for
filename
in
os
.
listdir
(
self
.
biasDir
):
for
filename
in
os
.
listdir
(
self
.
biasDir
):
match
=
pattern
.
match
(
filename
)
match
=
pattern
.
match
(
filename
)
if
match
is
not
None
:
if
match
is
not
None
:
...
...
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
View file @
452506eb
...
@@ -388,7 +388,7 @@ Parameters:
...
@@ -388,7 +388,7 @@ Parameters:
def
deserialize
(
inputString
)
:
def
deserialize
(
inputString
)
:
"""Reconstruct an object that has been serialized as XML."""
"""Reconstruct an object that has been serialized as XML."""
import
re
import
re
match
=
re
.
search
(
"<([^?]\S*)"
,
inputString
)
match
=
re
.
search
(
r
"<([^?]\S*)"
,
inputString
)
if
match
is
None
:
if
match
is
None
:
raise
ValueError
(
"Invalid input string"
)
raise
ValueError
(
"Invalid input string"
)
type
=
match
.
groups
()[
0
]
type
=
match
.
groups
()[
0
]
...
...
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