Skip to content

Commit

Permalink
fix: Update notebooks to use include_auxdata kwarg for `pyhf.Worksp…
Browse files Browse the repository at this point in the history
…ace.data` (#1588)

* Use `include_auxdata` kwarg for `pyhf.Workspace.data` as part of v0.6.3 API change
   - Amends PR #1562
  • Loading branch information
matthewfeickert authored Sep 4, 2021
1 parent 248e400 commit 173c3c7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/examples/notebooks/binderexample/StatisticalAnalysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@
" items.append(ax.bar(x, data, 1, alpha=1.0))\n",
" animate_plot_pieces = (\n",
" items,\n",
" ax.scatter(x, workspace.data(pdf, with_aux=False), c=\"k\", alpha=1.0, zorder=99),\n",
" ax.scatter(\n",
" x, workspace.data(pdf, include_auxdata=False), c=\"k\", alpha=1.0, zorder=99\n",
" ),\n",
" )\n",
"\n",
"\n",
Expand Down Expand Up @@ -241,7 +243,9 @@
" x = np.arange(len(data))\n",
" ax.bar(x, data, 1, bottom=bottom, alpha=1.0)\n",
" bottom = data if i == 0 else bottom + data\n",
" ax.scatter(x, workspace.data(pdf, with_aux=False), c=\"k\", alpha=1.0, zorder=99)"
" ax.scatter(\n",
" x, workspace.data(pdf, include_auxdata=False), c=\"k\", alpha=1.0, zorder=99\n",
" )"
]
},
{
Expand Down Expand Up @@ -1247,7 +1251,7 @@
"%matplotlib notebook\n",
"fig, ax = plt.subplots(1, 1)\n",
"fig.set_size_inches(10, 5)\n",
"ax.set_ylim(0, 1.5 * np.max(workspace.data(pdf, with_aux=False)))\n",
"ax.set_ylim(0, 1.5 * np.max(workspace.data(pdf, include_auxdata=False)))\n",
"\n",
"init_plot(fig, ax, default_par_settings)\n",
"interact(animate, fig=fixed(fig), ax=fixed(ax), **all_par_settings);"
Expand Down Expand Up @@ -2262,7 +2266,7 @@
"source": [
"fig, (ax1, ax2, ax3) = plt.subplots(1, 3, sharey=True, sharex=True)\n",
"fig.set_size_inches(18, 4)\n",
"ax1.set_ylim(0, 1.5 * np.max(workspace.data(pdf, with_aux=False)))\n",
"ax1.set_ylim(0, 1.5 * np.max(workspace.data(pdf, include_auxdata=False)))\n",
"ax1.set_title('nominal signal + background µ = 1')\n",
"plot(ax=ax1, **{k: nominal[v] for k, v in par_name_dict.items()})\n",
"\n",
Expand Down

0 comments on commit 173c3c7

Please sign in to comment.