Skip to content

Commit

Permalink
**/Snakefile: fix SyntaxWarning: invalid escape sequence '\d'
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Dec 19, 2024
1 parent 9c993f4 commit 8288771
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions benchmarks/backwards_ecal/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rule backwards_ecal_sim:
PARTICLE="(e-|pi-)",
ENERGY="[0-9]+[kMG]eV",
PHASE_SPACE="(3to50|45to135|130to177)deg",
INDEX="\d{4}",
INDEX=r"\d{4}",
params:
N_EVENTS=get_n_events,
SEED=lambda wildcards: "1" + wildcards.INDEX,
Expand Down Expand Up @@ -51,7 +51,7 @@ rule backwards_ecal_recon:
log:
"sim_output/backwards_ecal/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log",
wildcard_constraints:
INDEX="\d{4}",
INDEX=r"\d{4}",
params:
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/calo_pid/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rule calo_pid_sim:
ENERGY_MAX="[0-9]+[kMG]eV",
THETA_MIN="[0-9]+",
THETA_MAX="[0-9]+",
INDEX="\d{4}",
INDEX=r"\d{4}",
params:
N_EVENTS=1000,
SEED=lambda wildcards: "1" + wildcards.INDEX,
Expand Down Expand Up @@ -55,7 +55,7 @@ rule calo_pid_recon:
log:
"sim_output/calo_pid/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log",
wildcard_constraints:
INDEX="\d{4}",
INDEX=r"\d{4}",
shell: """
set -m # monitor mode to prevent lingering processes
exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/ecal_gaps/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rule ecal_gaps_sim:
PARTICLE="e-",
ENERGY="(500MeV|5GeV|20GeV)",
PHASE_SPACE="(3to50|45to135|130to177)deg",
INDEX="\d{4}",
INDEX=r"\d{4}",
params:
N_EVENTS=1000,
SEED=lambda wildcards: "1" + wildcards.INDEX,
Expand Down Expand Up @@ -47,7 +47,7 @@ rule ecal_gaps_recon:
log:
"sim_output/ecal_gaps/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log",
wildcard_constraints:
INDEX="\d{4}",
INDEX=r"\d{4}",
params:
DETECTOR_CONFIG=lambda wildcards: wildcards.DETECTOR_CONFIG,
EICRECON_HASH=get_spack_package_hash("eicrecon"),
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/lfhcal/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rule lfhcal_sim:
ENERGY="[0-9]+[kMG]eV",
PARTICLE="(neutron|pi-|gamma)",
PHASE_SPACE="3to50deg",
INDEX="\d{4}",
INDEX=r"\d{4}",
params:
N_EVENTS=get_n_events,
shell:
Expand All @@ -43,7 +43,7 @@ rule lfhcal_recon:
log:
"sim_output/lfhcal/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log",
wildcard_constraints:
INDEX="\d{4}",
INDEX=r"\d{4}",
shell: """
env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
eicrecon {input} -Ppodio:output_file={output} \
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/tracking_performances/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rule tracking_performance_sim:
PARTICLE="pi-",
ENERGY="[0-9]+[kMG]eV",
PHASE_SPACE="(3to50|45to135|130to177)deg",
INDEX="\d{4}",
INDEX=r"\d{4}",
params:
N_EVENTS=10000
shell:
Expand All @@ -37,7 +37,7 @@ rule tracking_performance_recon:
log:
"sim_output/tracking_performance/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.eicrecon.tree.edm4eic.root.log",
wildcard_constraints:
INDEX="\d{4}",
INDEX=r"\d{4}",
shell: """
set -m # monitor mode to prevent lingering processes
exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
Expand Down
32 changes: 16 additions & 16 deletions benchmarks/tracking_performances_dis/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ rule dis_analysis:
hists_vtx="results/vertexing_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_{INDEX}/hists.root",
wildcard_constraints:
PREFIX= ".*",
EBEAM="\d+",
PBEAM="\d+",
MINQ2="\d+",
INDEX="\d+",
EBEAM=r"\d+",
PBEAM=r"\d+",
MINQ2=r"\d+",
INDEX=r"\d+",
shell:
"""
cat > {output.config_trk} <<EOF
Expand Down Expand Up @@ -112,10 +112,10 @@ rule dis_combine:
hists_vtx="results/vertexing_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_combined_{NUM_FILES}/hists.root",
wildcard_constraints:
PREFIX= ".*",
EBEAM="\d+",
PBEAM="\d+",
MINQ2="\d+",
NUM_FILES="\d+",
EBEAM=r"\d+",
PBEAM=r"\d+",
MINQ2=r"\d+",
NUM_FILES=r"\d+",
shell:
"""
cat > {output.config_trk} <<EOF
Expand Down Expand Up @@ -155,10 +155,10 @@ rule trk_dis_plots:
"results/tracking_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_combined_{NUM_FILES}/plots.pdf"
wildcard_constraints:
PREFIX= ".*",
EBEAM="\d+",
PBEAM="\d+",
MINQ2="\d+",
NUM_FILES="\d+",
EBEAM=r"\d+",
PBEAM=r"\d+",
MINQ2=r"\d+",
NUM_FILES=r"\d+",
shell:
"""
root -l -b -q '{input.script}+("{input.config}")'
Expand All @@ -173,10 +173,10 @@ rule vtx_dis_plots:
"results/vertexing_performances_dis/{DETECTOR_CONFIG}/{PREFIX}pythia8NCDIS_{EBEAM}x{PBEAM}_minQ2={MINQ2}_combined_{NUM_FILES}/plots.pdf"
wildcard_constraints:
PREFIX= ".*",
EBEAM="\d+",
PBEAM="\d+",
MINQ2="\d+",
NUM_FILES="\d+",
EBEAM=r"\d+",
PBEAM=r"\d+",
MINQ2=r"\d+",
NUM_FILES=r"\d+",
shell:
"""
root -l -b -q '{input.script}+("{input.config}")'
Expand Down

0 comments on commit 8288771

Please sign in to comment.