diff --git a/.github/workflows/deploy-jupyter-book.yml b/.github/workflows/deploy-jupyter-book.yml index c5a74a7..f72315b 100644 --- a/.github/workflows/deploy-jupyter-book.yml +++ b/.github/workflows/deploy-jupyter-book.yml @@ -35,6 +35,11 @@ jobs: run: | python -m pip list + - name: Set track_progress=False for notebooks + run: | + git config --global --add safe.directory /__w/pyhf-tutorial/pyhf-tutorial + git grep --name-only "track_progress=True" book | xargs sed --in-place 's/track_progress=True/track_progress=False/g' + - name: Build the book run: | jupyter-book build book/ diff --git a/book/Toys.ipynb b/book/Toys.ipynb index bba90cc..8ed4bc6 100644 --- a/book/Toys.ipynb +++ b/book/Toys.ipynb @@ -64,15 +64,6 @@ "So the question is, does the asymptotic approximation hold in this example? The standard assumption is that you have enough \"statistics\" (meaning enough events) to use the large-N approximation. So let's use the toy-based calculator instead and compute the same values as above and see if they match in the asymptotic case (we certainly hope they mostly do here!)" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "```{note}\n", - "For readability in the Jupyter Book the `hypotest` has `track_progress=False`. If you're running this notebook yourself you might want to set `track_progress=True` to enable the progress bar.\n", - "```" - ] - }, { "cell_type": "code", "execution_count": null, @@ -87,7 +78,7 @@ " return_expected_set=True,\n", " calctype=\"toybased\",\n", " ntoys=1_000,\n", - " track_progress=False,\n", + " track_progress=True,\n", ")\n", "print(f\" Observed CLs: {CLs_obs:.4f}\")\n", "for expected_value, n_sigma in zip(CLs_exp, np.arange(-2, 3)):\n", @@ -168,7 +159,7 @@ " return_expected_set=True,\n", " calctype=\"toybased\",\n", " ntoys=5_000,\n", - " track_progress=False,\n", + " track_progress=True,\n", ")\n", "print(f\" Observed CLs: {CLs_obs:.4f}\")\n", "for expected_value, n_sigma in zip(CLs_exp, np.arange(-2, 3)):\n", diff --git a/book/UsingCalculators.ipynb b/book/UsingCalculators.ipynb index 9dd266d..a35aae0 100644 --- a/book/UsingCalculators.ipynb +++ b/book/UsingCalculators.ipynb @@ -224,15 +224,6 @@ "Let's create a toy-based calculator and \"throw\" 500 toys." ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "```{note}\n", - "For readability in the Jupyter Book the `ToyCalculator` has `track_progress=False`. If you're running this notebook yourself you might want to set `track_progress=True` to enable the progress bar.\n", - "```" - ] - }, { "cell_type": "code", "execution_count": null, @@ -240,7 +231,7 @@ "outputs": [], "source": [ "toy_calc = pyhf.infer.calculators.ToyCalculator(\n", - " data, model, test_stat=\"qtilde\", ntoys=500, track_progress=False\n", + " data, model, test_stat=\"qtilde\", ntoys=500, track_progress=True\n", ")" ] },