diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 600509be1..0d6e7790e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: diff --git a/python/ShipGeoConfig.py b/python/ShipGeoConfig.py index 969b94293..28d4fddc3 100644 --- a/python/ShipGeoConfig.py +++ b/python/ShipGeoConfig.py @@ -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() diff --git a/python/rpvsusy.py b/python/rpvsusy.py index 745fd049c..106e9b84e 100644 --- a/python/rpvsusy.py +++ b/python/rpvsusy.py @@ -1,4 +1,4 @@ -""" +r""" # ================================================================== # Python module # @@ -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: @@ -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))]) @@ -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 @@ -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: @@ -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: @@ -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: