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
4 changes: 2 additions & 2 deletions validphys2/src/validphys/comparefittemplates/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Dataset plots

Positivity
----------
{@with matched_positivity_from_dataspecs::dataspecs@}
{@plot_positivity@}
{@with matched_positivity_from_dataspecs@}
{@plot_dataspecs_positivity@}
{@endwith@}

Dataset differences and cuts
Expand Down
32 changes: 31 additions & 1 deletion validphys2/src/validphys/dataplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ def plot_positivity(pdfs, positivity_predictions_for_pdfs, posdataset, pos_use_k
yerr=[cv - lower, upper - cv],
linestyle='--',
marker='s',
label=pdf.label,
label=str(pdf),
lw=0.5,
transform=next(offsets)
)
Expand All @@ -927,6 +927,36 @@ def plot_positivity(pdfs, positivity_predictions_for_pdfs, posdataset, pos_use_k

return fig


@make_argcheck
def _check_same_posdataset_name(dataspecs_posdataset):
"""Check that the ``posdataset`` key matches for ``dataspecs``"""
_check_same_dataset_name.__wrapped__(
[ds.commondataspec for ds in dataspecs_posdataset]
)

@figure
@_check_same_posdataset_name
def plot_dataspecs_positivity(
dataspecs_speclabel,
dataspecs_positivity_predictions,
dataspecs_posdataset,
pos_use_kin=False,
):
"""Like :py:meth:`plot_positivity` except plots positivity for each
element of dataspecs, allowing positivity predictions to be generated with
different ``theory_id`` s as well as ``pdf`` s
"""
# we checked the positivity set matches between dataspecs so this is fine
posset = dataspecs_posdataset[0]
return plot_positivity(
dataspecs_speclabel,
dataspecs_positivity_predictions,
posset,
pos_use_kin,
)


@make_argcheck
def _check_display_cuts_requires_use_cuts(display_cuts, use_cuts):
check(
Expand Down
3 changes: 2 additions & 1 deletion validphys2/src/validphys/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,8 @@ def positivity_predictions_data_result(pdf, posdataset):


positivity_predictions_for_pdfs = collect(positivity_predictions_data_result, ("pdfs",))

dataspecs_positivity_predictions = collect(positivity_predictions_data_result, ("dataspecs",))
dataspecs_posdataset = collect("posdataset", ("dataspecs",))

def count_negative_points(possets_predictions):
"""Return the number of replicas with negative predictions for each bin
Expand Down