Skip to content

Commit

Permalink
chore: add check-ast, fix invalid escape seqs
Browse files Browse the repository at this point in the history
  • Loading branch information
olantwin committed Feb 20, 2025
1 parent 0baef4d commit 7c1387c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-ast
- id: check-merge-conflict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
hooks:
Expand Down
2 changes: 1 addition & 1 deletion python/ShipGeoConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def expand_env(string):
$HOME/bin -> /home/user/bin
"""
while True:
m = re.search("(\${*(\w+)}*)", string)
m = re.search(r"(\${*(\w+)}*)", string)
if m is None:
break
(env_token, env_name) = m.groups()
Expand Down
14 changes: 7 additions & 7 deletions python/rpvsusy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
r"""
# ==================================================================
# Python module
#
Expand Down Expand Up @@ -147,7 +147,7 @@ class RPVSUSYbranchings():
Lifetime and total and partial decay widths of an RPV neutralino
"""
def __init__(self, mass, couplings, sfmass, benchmark,debug=False):
"""
r"""
Initialize with mass and couplings of the RPV neutralino
Inputs:
Expand Down Expand Up @@ -311,7 +311,7 @@ def NdecayWidth(self):
Returns the total SUSYRPV neutralino decay width
"""
declist = self.decays[self.bench]
hadlist = [re.search('->\ (.+?)\ ',dec).group(1) for dec in declist]
hadlist = [re.search(r'->\ (.+?)\ ', dec).group(1) for dec in declist]
leplist = [dlist[1].strip() for dlist in [re.findall(r"\ \w+",dec) for dec in declist]]
print(leplist,hadlist)
totalwidth = sum([self.Width_H_L(hadlist[i],leplist[i]) for i in range(0,len(hadlist))])
Expand All @@ -322,7 +322,7 @@ def NprodWidth(self):
Returns the total SUSYRPV neutralino production width
"""
declist = self.prods[self.bench]
hadlist = [re.search('(.+?)\ ->',dec).group(1) for dec in declist]
hadlist = [re.search(r'(.+?)\ ->', dec).group(1) for dec in declist]
leplist = [dlist[1].strip() for dlist in [re.findall(r"\ \w+",dec) for dec in declist]]
totalwidth = sum([self.Width_N_L(hadlist[i],leplist[i]) for i in range(0,len(hadlist))])
return totalwidth
Expand All @@ -335,7 +335,7 @@ def findDecayBranchingRatio(self, decayString):
Inputs:
- decayString is a string describing the decay, in the form 'N -> stuff1 ... stuffN'
"""
had = re.search('->\ (.+?)\ ',decayString).group(1)
had = re.search(r'->\ (.+?)\ ', decayString).group(1)
decaysplit = decayString.split(' ')
for split in decaysplit:
if split.find('mu')>-1 or split.find('e')>-1 or split.find('tau')>-1:
Expand Down Expand Up @@ -377,7 +377,7 @@ def findProdBranchingRatio(self, decayString):
Inputs:
- decayString is a string describing the decay, in the form 'H -> N ... stuffN'
"""
had = re.search('(.+?)\ ->',decayString).group(1)
had = re.search(r'(.+?)\ ->', decayString).group(1)
decaysplit = decayString.split(' ')
for split in decaysplit:
if split.find('mu')>-1 or split.find('e')>-1 or split.find('tau')>-1:
Expand Down Expand Up @@ -413,7 +413,7 @@ class RPVSUSY(RPVSUSYbranchings):
SUSY RPV neutralino physics according to the nuMSM
"""
def __init__(self, mass, couplings, sfmass, benchmark, debug=False):
"""
r"""
Initialize with mass and couplings of the HNL
Inputs:
Expand Down

0 comments on commit 7c1387c

Please sign in to comment.