Skip to content

Commit ff9cb94

Browse files
docs: Update Binder to launch into JupyterLab environment (#2252)
* Install ipywidgets and ipympl to have interactive IPython widgets in modern JupyterLab. * Use from IPython.display import display to avoid using deprecated APIs. * Use %matplotlib widget to get interactive matplotlib in JupyterLab. * Use 'labpath' to open up file paths in JupyterLab.
1 parent 9797a21 commit ff9cb94

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ and grant `OAC-1450377 <https://www.nsf.gov/awardsearch/showAward?AWD_ID=1450377
372372
.. |Jupyter Book tutorial| image:: https://jupyterbook.org/_images/badge.svg
373373
:target: https://pyhf.github.io/pyhf-tutorial/
374374
.. |Binder| image:: https://mybinder.org/badge_logo.svg
375-
:target: https://mybinder.org/v2/gh/scikit-hep/pyhf/main?filepath=docs%2Fexamples%2Fnotebooks%2Fbinderexample%2FStatisticalAnalysis.ipynb
375+
:target: https://mybinder.org/v2/gh/scikit-hep/pyhf/main?labpath=docs%2Fexamples%2Fnotebooks%2Fbinderexample%2FStatisticalAnalysis.ipynb
376376
377377
.. |PyPI version| image:: https://badge.fury.io/py/pyhf.svg
378378
:target: https://badge.fury.io/py/pyhf

binder/postBuild

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
python -m pip install --upgrade '.[all]'
2-
python -m pip install altair
2+
python -m pip install --upgrade \
3+
ipywidgets \
4+
ipympl \
5+
altair

docs/examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Examples
44
Try out in Binder! |Binder|
55

66
.. |Binder| image:: https://mybinder.org/badge_logo.svg
7-
:target: https://mybinder.org/v2/gh/scikit-hep/pyhf/main?filepath=docs%2Fexamples%2Fnotebooks%2Fbinderexample%2FStatisticalAnalysis.ipynb
7+
:target: https://mybinder.org/v2/gh/scikit-hep/pyhf/main?labpath=docs%2Fexamples%2Fnotebooks%2Fbinderexample%2FStatisticalAnalysis.ipynb
88

99
Notebooks:
1010

docs/examples/notebooks/binderexample/StatisticalAnalysis.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"from pyhf.contrib.viz import brazil\n",
1717
"\n",
1818
"import base64\n",
19-
"from IPython.core.display import display, HTML\n",
19+
"from IPython.display import display, HTML\n",
2020
"from ipywidgets import interact, fixed"
2121
]
2222
},
@@ -1248,7 +1248,7 @@
12481248
}
12491249
],
12501250
"source": [
1251-
"%matplotlib notebook\n",
1251+
"%matplotlib widget\n",
12521252
"fig, ax = plt.subplots(1, 1)\n",
12531253
"fig.set_size_inches(10, 5)\n",
12541254
"ax.set_ylim(0, 1.5 * np.max(workspace.data(pdf, include_auxdata=False)))\n",

0 commit comments

Comments
 (0)