Skip to content

Commit 2597b3e

Browse files
committed
Merge branch 'maint'
* MAINT: use raw strings in re patterns
2 parents 0a25eb8 + 8c9b48a commit 2597b3e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/diffpy/Structure/SymmetryUtilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def check_cubic():
8383
# compiled per every single call.
8484

8585
_rx_constant_formula = re.compile(
86-
'[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)??(/[-+]?\d+)?$')
86+
r'[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)??(/[-+]?\d+)?$')
8787

8888
def isconstantFormula(s):
8989
"""Check if formula string is constant. True when argument

src/diffpy/Structure/applications/anyeye.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def cleanUp(pd):
144144
def parseFormula(formula):
145145
"""parse chemical formula and return a list of elements"""
146146
# remove all blanks
147-
formula = re.sub('\s', '', formula)
147+
formula = re.sub(r'\s', '', formula)
148148
if not re.match('^[A-Z]', formula):
149149
raise RuntimeError("InvalidFormula '%s'" % formula)
150150
elcnt = re.split('([A-Z][a-z]?)', formula)[1:]

0 commit comments

Comments
 (0)