Skip to content

Commit

Permalink
fix SyntaxWarning: invalid escape sequence (ParmEd#1350)
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Jun 24, 2024
1 parent 7eb0645 commit cc8b774
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions parmed/amber/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
_bondre = re.compile(r'(..?)-(..?)\s+%(FLOATRE)s\s+%(FLOATRE)s' % subs)
_anglere = re.compile(r'(..?)-(..?)-(..?)\s+%(FLOATRE)s\s+%(FLOATRE)s' % subs)
_dihedre = re.compile(r'(..?)-(..?)-(..?)-(..?)\s+%(FLOATRE)s\s+'
'%(FLOATRE)s\s+%(FLOATRE)s\s+%(FLOATRE)s' % subs)
r'%(FLOATRE)s\s+%(FLOATRE)s\s+%(FLOATRE)s' % subs)
_dihed2re = re.compile(r'\s*%(FLOATRE)s\s+%(FLOATRE)s\s+%(FLOATRE)s\s+'
'%(FLOATRE)s' % subs)
_sceere = re.compile(r'SCEE=\s*%(FLOATRE)s' % subs)
_scnbre = re.compile(r'SCNB=\s*%(FLOATRE)s' % subs)
_impropre = re.compile(r'(..?)-(..?)-(..?)-(..?)\s+'
'%(FLOATRE)s\s+%(FLOATRE)s\s+%(FLOATRE)s' % subs)
r'%(FLOATRE)s\s+%(FLOATRE)s\s+%(FLOATRE)s' % subs)
# Leaprc regexes
_atomtypere = re.compile(r"""({\s*["']([\w\+\-]+)["']\s*["'](\w+)["']\s*"""
r"""["'](\w+)["']\s*})""")
Expand Down
22 changes: 11 additions & 11 deletions parmed/formats/pdbx/PdbxReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,16 +326,16 @@ def __tokenizer(self, ifh):
mmcifRe = re.compile(
r"(?:"

"(?:_(.+?)[.](\S+))" "|" # _category.attribute
r"(?:_(.+?)[.](\S+))" r"|" # _category.attribute

"(?:['](.*?)(?:[']\s|[']$))" "|" # single quoted strings
"(?:[\"](.*?)(?:[\"]\s|[\"]$))" "|" # double quoted strings
r"(?:['](.*?)(?:[']\s|[']$))" r"|" # single quoted strings
r"(?:[\"](.*?)(?:[\"]\s|[\"]$))" r"|" # double quoted strings

"(?:\s*#.*$)" "|" # comments (dumped)
r"(?:\s*#.*$)" r"|" # comments (dumped)

"(\S+)" # unquoted words
r"(\S+)" # unquoted words

")")
r")")

fileIter = iter(ifh)

Expand Down Expand Up @@ -398,15 +398,15 @@ def __tokenizerOrg(self, ifh):
mmcifRe = re.compile(
r"(?:"

"(?:_(.+?)[.](\S+))" "|" # _category.attribute
r"(?:_(.+?)[.](\S+))" r"|" # _category.attribute

"(?:['\"](.*?)(?:['\"]\s|['\"]$))" "|" # quoted strings
r"(?:['\"](.*?)(?:['\"]\s|['\"]$))" r"|" # quoted strings

"(?:\s*#.*$)" "|" # comments (dumped)
r"(?:\s*#.*$)" r"|" # comments (dumped)

"(\S+)" # unquoted words
r"(\S+)" # unquoted words

")")
r")")

fileIter = iter(ifh)

Expand Down

0 comments on commit cc8b774

Please sign in to comment.