Skip to content

Commit

Permalink
Add tests for other criteria cases
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodingJamie committed Sep 17, 2024
1 parent bae3556 commit 0fcbce1
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 4 deletions.
37 changes: 35 additions & 2 deletions phys/root/filter/test/Snakefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,48 @@
rule define_columns:
rule filter_str:
input:
"ntuple0.root",
output:
"ntuple0_output.root",
"ntuple0_str_output.root",
log:
"logs/filter/filter_str.log",
params:
input_tree_name="TestTree",
output_tree_name="TestTree",
criteria="pt > 1400",
branches_to_save=["pz", "pt", "p"],
threads: 2
wrapper:
"master/phys/root/filter"

rule filter_list:
input:
"ntuple0.root",
output:
"ntuple0_list_output.root",
log:
"logs/filter/filter_list.log",
params:
input_tree_name="TestTree",
output_tree_name="TestTree",
criteria=["pt > 1400", "pz > 19000"],
branches_to_save=["pz", "pt", "p"],
threads: 2
wrapper:
"master/phys/root/filter"

rule filter_dict:
input:
"ntuple0.root",
output:
"ntuple0_dict_output.root",
log:
"logs/filter/filter.log",
params:
input_tree_name="TestTree",
output_tree_name="TestTree",
criteria="pt > 1400",
branches_to_save=["pz", "pt", "p"],
verbose=True
threads: 2
wrapper:
"master/phys/root/filter"
20 changes: 18 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6829,10 +6829,26 @@ def test_root_define_columns():


@skip_if_not_modified
def test_root_filter():
def test_root_filter_str():
run(
"phys/root/filter",
["snakemake", "--cores", "2", "--use-conda", "-F"],
["snakemake", "--cores", "2", "--use-conda", "-F", "ntuple0_str_output.root"],
)


@skip_if_not_modified
def test_root_filter_list():
run(
"phys/root/filter",
["snakemake", "--cores", "2", "--use-conda", "-F", "ntuple0_list_output.root"],
)


@skip_if_not_modified
def test_root_filter_dict():
run(
"phys/root/filter",
["snakemake", "--cores", "2", "--use-conda", "-F", "ntuple0_dict_output.root"],
)


Expand Down

0 comments on commit 0fcbce1

Please sign in to comment.