From 7ad2a4d155f83416ed1e6950985158ddd971ce49 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Thu, 6 Apr 2023 20:45:57 -0500 Subject: [PATCH] feat: Update to pyhf v0.7.1 (#42) * Update to pyhf v0.7.1 - Update URLs to point to v0.7.1. * Update requirements.txt and rebuild lock file. --- README.md | 2 +- binder/requirements.txt | 2 +- book/HelloWorld.ipynb | 8 ++++---- book/Modifiers.ipynb | 4 ++-- book/SerializationAndPatching.ipynb | 2 +- book/SimpleWorkspace.ipynb | 4 ++-- book/WorkspaceManipulations.ipynb | 8 ++++---- book/introduction.md | 10 +++++----- book/requirements.lock | 7 ++++--- 9 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 9f1a212..f495883 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Tutorial last given at the [April 2021 PyHEP topical meeting](https://indico.cern.ch/event/985425/). -**The tutorial is based off of [`pyhf` `v0.7.0`](https://pypi.org/project/pyhf/0.7.0/)** +**The tutorial is based off of [`pyhf` `v0.7.1`](https://pypi.org/project/pyhf/0.7.1/)** [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pyhf/pyhf-tutorial/main?urlpath=lab) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4670321.svg)](https://doi.org/10.5281/zenodo.4670321) diff --git a/binder/requirements.txt b/binder/requirements.txt index 6d5b563..c5425a8 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1,4 +1,4 @@ -pyhf[xmlio,minuit,contrib]==0.7.0 +pyhf[xmlio,minuit,contrib]==0.7.1 # visualization ipywidgets~=7.5 pandas~=1.0 diff --git a/book/HelloWorld.ipynb b/book/HelloWorld.ipynb index b832765..24f8db5 100644 --- a/book/HelloWorld.ipynb +++ b/book/HelloWorld.ipynb @@ -49,7 +49,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "What did we just make? This returns a [`pyhf.pdf.Model`](https://pyhf.readthedocs.io/en/v0.7.0/_generated/pyhf.pdf.Model.html#pyhf.pdf.Model) object. Let's check out the specification." + "What did we just make? This returns a [`pyhf.pdf.Model`](https://pyhf.readthedocs.io/en/v0.7.1/_generated/pyhf.pdf.Model.html#pyhf.pdf.Model) object. Let's check out the specification." ] }, { @@ -144,7 +144,7 @@ "\n", "where $n = \\{n_1, n_2\\}$ for a 2-bin model (we're being slightly fast and loose with our mathematical notation here), and similarly for $s$, $b$, and $\\gamma$.\n", "\n", - "The 'shapesys' is defined in the [HistFactory paper](https://cds.cern.ch/record/1456844)... however, it can be a little hard to extract out the necessary information. We've provided a nice table of [Modifiers and Constraints](https://pyhf.readthedocs.io/en/v0.7.0/intro.html#id24) in the introduction of our pyhf documentation to use as reference.\n", + "The 'shapesys' is defined in the [HistFactory paper](https://cds.cern.ch/record/1456844)... however, it can be a little hard to extract out the necessary information. We've provided a nice table of [Modifiers and Constraints](https://pyhf.readthedocs.io/en/v0.7.1/intro.html#id24) in the introduction of our pyhf documentation to use as reference.\n", "\n", "![modifiers and constraints](assets/modifiers_and_constraints.png)" ] @@ -515,7 +515,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We're not performing inference just yet. We're simply computing the 'logpdf' of the model specified by the parameters $\\theta$ against the provided data. To perform a fit, we use the [inference API](https://pyhf.readthedocs.io/en/v0.7.0/api.html#inference) via `pyhf.infer`.\n", + "We're not performing inference just yet. We're simply computing the 'logpdf' of the model specified by the parameters $\\theta$ against the provided data. To perform a fit, we use the [inference API](https://pyhf.readthedocs.io/en/v0.7.1/api.html#inference) via `pyhf.infer`.\n", "\n", "When fitting a model to data, we usually want to find the $\\hat{\\theta}$ which refers to the \"Maximum Likelihood Estimate\" of the model parameters. This is often referred to mathematically by\n", "\n", @@ -675,7 +675,7 @@ "source": [ "## Simple Upper Limit\n", "\n", - "To get upper limits, we just need to run multiple hypothesis tests for a lot of different null hypotheses of BSM with $\\mu \\in [0, \\ldots, 5.0]$ and then find the value of $\\mu$ for which the null hypothesis is rejected (a 95% $\\text{CL}_\\text{s}$). We can do all of this very easily just using the [`upper_limits.upper_limit` API](https://pyhf.readthedocs.io/en/v0.7.0/_generated/pyhf.infer.intervals.upper_limits.upper_limit.html#pyhf.infer.intervals.upper_limits.upper_limit), which also can calculate the upper limit by interpolating" + "To get upper limits, we just need to run multiple hypothesis tests for a lot of different null hypotheses of BSM with $\\mu \\in [0, \\ldots, 5.0]$ and then find the value of $\\mu$ for which the null hypothesis is rejected (a 95% $\\text{CL}_\\text{s}$). We can do all of this very easily just using the [`upper_limits.upper_limit` API](https://pyhf.readthedocs.io/en/v0.7.1/_generated/pyhf.infer.intervals.upper_limits.upper_limit.html#pyhf.infer.intervals.upper_limits.upper_limit), which also can calculate the upper limit by interpolating" ] }, { diff --git a/book/Modifiers.ipynb b/book/Modifiers.ipynb index caa00b0..087e867 100644 --- a/book/Modifiers.ipynb +++ b/book/Modifiers.ipynb @@ -8,9 +8,9 @@ "source": [ "# Modifiers\n", "\n", - "In our simple examples so far, we've only used two types of modifiers, but HistFactory allows for a handful of modifiers that have proven to be sufficient to model a wide range of uncertainties. Each of the modifiers is further described in the [Modifiers section](https://pyhf.readthedocs.io/en/v0.7.0/likelihood.html#modifiers) of the pyhf docs on model specification.\n", + "In our simple examples so far, we've only used two types of modifiers, but HistFactory allows for a handful of modifiers that have proven to be sufficient to model a wide range of uncertainties. Each of the modifiers is further described in the [Modifiers section](https://pyhf.readthedocs.io/en/v0.7.1/likelihood.html#modifiers) of the pyhf docs on model specification.\n", "\n", - "There is an addtional table of [Modifiers and Constraints](https://pyhf.readthedocs.io/en/v0.7.0/intro.html#id24) in the introduction of the pyhf documentation to use as reference.\n", + "There is an addtional table of [Modifiers and Constraints](https://pyhf.readthedocs.io/en/v0.7.1/intro.html#id24) in the introduction of the pyhf documentation to use as reference.\n", "\n", "![modifiers and constraints](assets/modifiers_and_constraints.png)\n", "\n", diff --git a/book/SerializationAndPatching.ipynb b/book/SerializationAndPatching.ipynb index 005fc8c..8f2193a 100644 --- a/book/SerializationAndPatching.ipynb +++ b/book/SerializationAndPatching.ipynb @@ -107,7 +107,7 @@ "source": [ "## Patching in Signals\n", "\n", - "Let's look at this [`pyhf.PatchSet`](https://pyhf.readthedocs.io/en/v0.7.0/_generated/pyhf.patchset.PatchSet.html#pyhf.patchset.PatchSet) object which provides a user-friendly way to interact with many signal patches at once.\n", + "Let's look at this [`pyhf.PatchSet`](https://pyhf.readthedocs.io/en/v0.7.1/_generated/pyhf.patchset.PatchSet.html#pyhf.patchset.PatchSet) object which provides a user-friendly way to interact with many signal patches at once.\n", "\n", "### PatchSet" ] diff --git a/book/SimpleWorkspace.ipynb b/book/SimpleWorkspace.ipynb index 681e687..7f0ba94 100644 --- a/book/SimpleWorkspace.ipynb +++ b/book/SimpleWorkspace.ipynb @@ -67,7 +67,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "What did we just make? This returns a [`pyhf.Workspace`](https://pyhf.readthedocs.io/en/v0.7.0/_generated/pyhf.workspace.Workspace.html#pyhf.workspace.Workspace) object. Let's check out the specification." + "What did we just make? This returns a [`pyhf.Workspace`](https://pyhf.readthedocs.io/en/v0.7.1/_generated/pyhf.workspace.Workspace.html#pyhf.workspace.Workspace) object. Let's check out the specification." ] }, { @@ -142,7 +142,7 @@ "source": [ "What does this mean for us though? Well, when we ask for a model, we specify the measurement that we want to use with it. Each of these measurements above have no additional parameter configurations on top of the existing model specification. Additionally, they all declare that the parameter of interest is `mu`.\n", "\n", - "See the [documentation](https://pyhf.readthedocs.io/en/v0.7.0/_generated/pyhf.workspace.Workspace.html#pyhf.workspace.Workspace.model) for more information. In this case, let's build the model for the default measurement." + "See the [documentation](https://pyhf.readthedocs.io/en/v0.7.1/_generated/pyhf.workspace.Workspace.html#pyhf.workspace.Workspace.model) for more information. In this case, let's build the model for the default measurement." ] }, { diff --git a/book/WorkspaceManipulations.ipynb b/book/WorkspaceManipulations.ipynb index 487beff..0bb7279 100644 --- a/book/WorkspaceManipulations.ipynb +++ b/book/WorkspaceManipulations.ipynb @@ -207,7 +207,7 @@ "\n", "### via the command line\n", "\n", - "So pyhf comes with a lot of nifty utilities you can access. The documentation for the command line can be found via `pyhf --help` or [online](https://pyhf.readthedocs.io/en/v0.7.0/cli.html)." + "So pyhf comes with a lot of nifty utilities you can access. The documentation for the command line can be found via `pyhf --help` or [online](https://pyhf.readthedocs.io/en/v0.7.1/cli.html)." ] }, { @@ -229,7 +229,7 @@ "python -m pip install pyhf[xmlio]\n", "```\n", "\n", - "Again, the online documentation for this option is found [here](https://pyhf.readthedocs.io/en/v0.7.0/cli.html#pyhf-xml2json)." + "Again, the online documentation for this option is found [here](https://pyhf.readthedocs.io/en/v0.7.1/cli.html#pyhf-xml2json)." ] }, { @@ -292,7 +292,7 @@ "\n", "Nearly at the end, the next part of this specification is for the `observations` (observed data) on line 113. Each observation corresponds with the channel, where `channel1` has two bins, and `channel2` also has two bins.\n", "\n", - "Finally, we have a `version` which specifies the version of the schema used for the JSON HistFactory. In this case, we're using `1.0.0` which has the [https://pyhf.readthedocs.io/en/v0.7.0/schemas/1.0.0/workspace.json](https://pyhf.readthedocs.io/en/v0.7.0/schemas/1.0.0/workspace.json) definition which refers to the [https://pyhf.readthedocs.io/en/v0.7.0/schemas/1.0.0/defs.json](https://pyhf.readthedocs.io/en/v0.7.0/schemas/1.0.0/defs.json).\n", + "Finally, we have a `version` which specifies the version of the schema used for the JSON HistFactory. In this case, we're using `1.0.0` which has the [https://pyhf.readthedocs.io/en/v0.7.1/schemas/1.0.0/workspace.json](https://pyhf.readthedocs.io/en/v0.7.1/schemas/1.0.0/workspace.json) definition which refers to the [https://pyhf.readthedocs.io/en/v0.7.1/schemas/1.0.0/defs.json](https://pyhf.readthedocs.io/en/v0.7.1/schemas/1.0.0/defs.json).\n", "\n", "What's really nice about the schema definition is that it allows anyone to write their own tooling/scripting to build up the workspace and quickly check if it matches the schema. This will get you 90% of the way there in having a valid workspace to work with.\n", "\n", @@ -330,7 +330,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "So we're not going to dump this out. We already did that above. Let's just quickly go ahead and load it into a [`pyhf.Workspace`](https://pyhf.readthedocs.io/en/v0.7.0/_generated/pyhf.workspace.Workspace.html#pyhf.workspace.Workspace) object because we can." + "So we're not going to dump this out. We already did that above. Let's just quickly go ahead and load it into a [`pyhf.Workspace`](https://pyhf.readthedocs.io/en/v0.7.1/_generated/pyhf.workspace.Workspace.html#pyhf.workspace.Workspace) object because we can." ] }, { diff --git a/book/introduction.md b/book/introduction.md index fb6c0c9..bf5133b 100644 --- a/book/introduction.md +++ b/book/introduction.md @@ -122,7 +122,7 @@ The 'minuit' extra installs [`iminuit`](https://iminuit.readthedocs.io/). :::: -See our [installation docs](https://pyhf.readthedocs.io/en/v0.7.0/installation.html) for more information about installation options. +See our [installation docs](https://pyhf.readthedocs.io/en/v0.7.1/installation.html) for more information about installation options. ### Dependencies for this tutorial @@ -146,11 +146,11 @@ If you want to also get the dependencies to build and explore the Jupyter Book f (pyhf-tutorial) $ pyhf --citation @software{pyhf, author = {Lukas Heinrich and Matthew Feickert and Giordon Stark}, - title = "{pyhf: v0.7.0}", - version = {0.7.0}, + title = "{pyhf: v0.7.1}", + version = {0.7.1}, doi = {10.5281/zenodo.1169739}, url = {https://doi.org/10.5281/zenodo.1169739}, - note = {https://github.com/scikit-hep/pyhf/releases/tag/v0.7.0} + note = {https://github.com/scikit-hep/pyhf/releases/tag/v0.7.1} } @article{pyhf_joss, @@ -167,7 +167,7 @@ If you want to also get the dependencies to build and explore the Jupyter Book f } ``` -Alternatively, [check the website](https://pyhf.readthedocs.io/en/v0.7.0/citations.html). +Alternatively, [check the website](https://pyhf.readthedocs.io/en/v0.7.1/citations.html). ### Statistics References diff --git a/book/requirements.lock b/book/requirements.lock index 0dc4f14..9dc2a37 100644 --- a/book/requirements.lock +++ b/book/requirements.lock @@ -983,6 +983,7 @@ numpy==1.24.2 \ # iminuit # matplotlib # pandas + # pyhf # scipy # uproot packaging==23.0 \ @@ -1197,9 +1198,9 @@ pygments==2.14.0 \ # pydata-sphinx-theme # qtconsole # sphinx -pyhf[contrib,minuit,xmlio]==0.7.0 \ - --hash=sha256:6513563e72ff8b6635676f2d2abfcfd015b654cafbdcd4b5b72834152e4f029b \ - --hash=sha256:cf2c7dc9456ef0fadb6b52c041b905cc973b2c83f954390ba65b45ab74916879 +pyhf[contrib,minuit,xmlio]==0.7.1 \ + --hash=sha256:1a3007bb2858bab2ffee37cd7b2fe4a0dd3faf18cc49c45f6696c299880dfadf \ + --hash=sha256:26a5058c4ec89e5116925ca16559087e733612ebbf2da005f4202c6b7200def2 # via -r /home/feickert/Code/GitHub/tutorials/pyhf-tutorial/requirements.txt pyparsing==3.0.9 \ --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \