Skip to content

Commit

Permalink
make sure we have tests covering the cases we expect
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg authored and matthewfeickert committed Sep 5, 2022
1 parent 16ac2af commit a0b47ea
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions tests/test_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ def test_pdf_clipping(backend):
pyhf.infer.mle.fit(data, model_clip_bin)


def test_is_shared_paramset_shapesys_diff_sample():
def test_is_shared_paramset_shapesys_diff_sample_diff_channel():
spec = {
"channels": [
{
Expand Down Expand Up @@ -1227,7 +1227,52 @@ def test_is_shared_paramset_shapesys_diff_sample():
pyhf.Workspace(spec).model()


def test_is_shared_paramset_shapesys_same_sample():
def test_is_shared_paramset_shapesys_diff_sample_same_channel():
spec = {
"channels": [
{
"name": "SR",
"samples": [
{
"data": [50],
"modifiers": [
{
"data": [9],
"name": "abc",
"type": "shapesys",
},
{
"data": None,
"name": "Signal strength",
"type": "normfactor",
},
],
"name": "Signal",
},
{
"data": [150],
"modifiers": [
{
"data": [7],
"name": "abc",
"type": "shapesys",
}
],
"name": "Background",
},
],
}
],
"measurements": [{"config": {"parameters": [], "poi": ""}, "name": "meas"}],
"observations": [{"data": [160], "name": "SR"}],
"version": "1.0.0",
}

with pytest.raises(pyhf.exceptions.InvalidModel):
pyhf.Workspace(spec).model()


def test_is_shared_paramset_shapesys_same_sample_same_channel():
spec = {
"channels": [
{
Expand Down

0 comments on commit a0b47ea

Please sign in to comment.