Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion validphys2/src/validphys/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ def produce_group_dataset_inputs_by_metadata(
if processed_metadata_group == "custom_group":
group_name = str(dsinput.custom_group)
# special case of ALL, grouping everything together
if processed_metadata_group == "ALL":
elif processed_metadata_group == "ALL":
group_name = processed_metadata_group
# otherwise try and take the key from the metadata.
else:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 36 additions & 10 deletions validphys2/src/validphys/tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,40 @@ def test_plot_xq2():
metadata_group = "experiment"
dataset_inputs = [
{'dataset': 'NMC'},
{'dataset': 'ATLASTTBARTOT', 'cfac':['QCD']},
{'dataset': 'CMSZDIFF12', 'cfac':('QCD', 'NRM'), 'sys':10}
]
{'dataset': 'ATLASTTBARTOT', 'cfac': ['QCD']},
{'dataset': 'CMSZDIFF12', 'cfac': ('QCD', 'NRM'), 'sys': 10},
]

return API.plot_xq2(
theoryid=theoryid,
use_cuts=use_cuts,
dataset_inputs=dataset_inputs,
display_cuts=display_cuts,
marker_by=marker_by,
metadata_group=metadata_group)
theoryid=theoryid,
use_cuts=use_cuts,
dataset_inputs=dataset_inputs,
display_cuts=display_cuts,
marker_by=marker_by,
metadata_group=metadata_group,
)

@pytest.mark.linux
@pytest.mark.mpl_image_compare
def test_plot_xq2_custom():
theoryid = THEORYID
use_cuts = "nocuts"
display_cuts = False

marker_by = "group"
metadata_group = "custom_group"

dataset_inputs = [
{'dataset': 'NMC', 'custom_group': 'one'},
{'dataset': 'ATLASTTBARTOT', 'cfac': ['QCD'], 'custom_group': 'one'},
{'dataset': 'CMSZDIFF12', 'cfac': ('QCD', 'NRM'), 'sys': 10, 'custom_group': 'two'},
]

return API.plot_xq2(
theoryid=theoryid,
use_cuts=use_cuts,
dataset_inputs=dataset_inputs,
display_cuts=display_cuts,
marker_by=marker_by,
metadata_group=metadata_group,
)