Skip to content

Commit

Permalink
fix: Add poi_name to Model construction in notebooks (#2336)
Browse files Browse the repository at this point in the history
* Ensure all pyhf.Model calls in the example notebooks that don't
  already have a poi_name definied have `poi_name="mu"` set.
* Amends PR #2328
  • Loading branch information
matthewfeickert authored Sep 20, 2023
1 parent 66ecdd8 commit c096b33
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/examples/notebooks/ShapeFactor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
" },\n",
" ]\n",
" }\n",
" pdf = pyhf.Model(spec)\n",
" pdf = pyhf.Model(spec, poi_name=\"mu\")\n",
" data = []\n",
" for channel in pdf.config.channels:\n",
" data += sourcedata[channel]['bindata']['data']\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/notebooks/StatError.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
" # }\n",
" ]\n",
"}\n",
"p = pyhf.Model(spec)"
"p = pyhf.Model(spec, poi_name=\"mu\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/notebooks/histogrammar.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"metadata": {},
"outputs": [],
"source": [
"p = pyhf.Model(spec)\n",
"p = pyhf.Model(spec, poi_name=\"mu\")\n",
"\n",
"data = data_histogram.toJson()['data']['values'] + p.config.auxdata"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/notebooks/histosys.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
" },\n",
" }\n",
" }\n",
" pdf = Model(spec)\n",
" pdf = Model(spec, poi_name=\"mu\")\n",
" data = source['bindata']['data'] + pdf.config.auxdata\n",
" return data, pdf"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/notebooks/multichannel-coupled-histo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
" },\n",
" ]\n",
" }\n",
" pdf = Model(spec)\n",
" pdf = Model(spec, poi_name=\"mu\")\n",
" data = []\n",
" for channel in pdf.config.channels:\n",
" data += sourcedata[channel][\"bindata\"][\"data\"]\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/notebooks/multichannel-coupled-normsys.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
" }\n",
" },\n",
" }\n",
" pdf = Model(spec)\n",
" pdf = Model(spec, poi_name=\"mu\")\n",
" data = []\n",
" for c in pdf.config.channel_order:\n",
" data += sourcedata[c]['bindata']['data']\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/notebooks/normsys.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
" },\n",
" }\n",
" }\n",
" pdf = Model(spec)\n",
" pdf = Model(spec, poi_name=\"mu\")\n",
" data = observed_counts + pdf.config.auxdata\n",
" return data, pdf"
]
Expand Down

0 comments on commit c096b33

Please sign in to comment.