Skip to content

Commit d8d6d4f

Browse files
feat: Upgrade to Jupyter Book v2 (#107)
* Migrate to Jupyter Book v2. - book/_config.yml and book/_toc.yml are combined into book/myst.yml. - Update Pixi commands to use 'cwd' to be in the correct directory tree for myst. * Upgrade Pixi workspace. - Add insecure run-post-link-scripts for ROOT. - Update Pixi 'start' task to default to serving the book.
1 parent 1bb46ee commit d8d6d4f

File tree

7 files changed

+8676
-6007
lines changed

7 files changed

+8676
-6007
lines changed

.pixi/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
run-post-link-scripts = "insecure"

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ To build the book after setup simply run
3434
### Using `pixi`
3535

3636
```
37-
pixi run build
37+
pixi run start
3838
```
3939

40+
to build and serve the book
41+
4042
### Local virtual environment
4143

4244
```

book/_config.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

book/_toc.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

book/myst.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: 1
2+
project:
3+
title: pyhf Tutorial
4+
authors:
5+
- name: the pyhf development team
6+
github: pyhf/pyhf-tutorial
7+
jupyter:
8+
binder:
9+
repo: pyhf/pyhf-tutorial
10+
ref: main
11+
provider: github
12+
url: mybinder.org
13+
exports:
14+
- format: pdf
15+
template: plain_latex_book
16+
output: exports/book.pdf
17+
toc:
18+
- file: introduction.md
19+
- title: Get started
20+
children:
21+
- file: HelloWorld.ipynb
22+
- file: SimpleWorkspace.ipynb
23+
- file: SerializationAndPatching.ipynb
24+
- title: Common use and applications
25+
children:
26+
- file: PullPlot.ipynb
27+
- file: Toys.ipynb
28+
- file: Combinations.ipynb
29+
- file: UpperLimitsTable.ipynb
30+
- title: More Information
31+
children:
32+
- file: IntroToHiFa.ipynb
33+
- file: WorkspaceManipulations.ipynb
34+
- file: Modifiers.ipynb
35+
- file: UsingCalculators.ipynb
36+
- title: Learn Fundamentals
37+
children:
38+
- file: InterpolationCodes.ipynb
39+
site:
40+
options:
41+
logo: assets/pyhf-logo.svg
42+
folders: true
43+
template: book-theme

pixi.lock

Lines changed: 8594 additions & 5920 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,52 @@
1-
[project]
1+
[workspace]
22
authors = ["Matthew Feickert <matthew.feickert@cern.ch>"]
33
channels = ["conda-forge"]
44
description = "pyhf user guide"
55
name = "pyhf-tutorial"
66
platforms = ["linux-64", "osx-64", "osx-arm64"]
77
version = "0.7.6"
88

9-
[tasks.start]
10-
description = "Launch Jupyer Lab and explore the user guide notebooks"
11-
cmd = "jupyter lab"
12-
139
[dependencies]
14-
python = "3.12.*"
10+
python = ">=3.13.9,<3.14"
1511
pyhf = "0.7.6.*"
16-
uproot = ">=5.5.1,<6"
17-
iminuit = ">=2.30.1,<3"
18-
matplotlib-base = ">=3.10.0,<4"
19-
requests = ">=2.32.3,<3"
12+
uproot = ">=5.6.8,<6"
13+
iminuit = ">=2.32.0,<3"
14+
matplotlib-base = ">=3.10.8,<4"
15+
requests = ">=2.32.5,<3"
2016
# visualization
21-
ipywidgets = ">=8.1.5,<9"
22-
ipympl = ">=0.9.5,<0.10"
23-
pandas = ">=2.2.3,<3"
24-
altair = ">=5.5.0,<6"
25-
rich = ">=13.9.4,<14"
26-
# jupyter notebooks
27-
notebook = ">=7.3.2,<8"
28-
jupyterlab = ">=4.3.4,<5"
17+
ipywidgets = ">=8.1.8,<9"
18+
ipympl = ">=0.9.8,<0.10"
19+
pandas = ">=2.3.3,<3"
20+
altair = ">=6.0.0,<7"
21+
rich = ">=14.2.0,<15"
22+
# comparison
23+
root_base = ">=6.36.4,<7"
24+
25+
[feature.lab.dependencies]
26+
notebook = ">=7.5.0,<8"
27+
jupyterlab = ">=4.5.0,<5"
28+
29+
[feature.lab.tasks.lab]
30+
description = "Launch Jupyer Lab and explore the user guide notebooks"
31+
cmd = "jupyter lab"
2932

3033
[feature.book.tasks.build]
3134
description = "Build the Jupyter Book"
32-
cmd = "jupyter-book build book/"
35+
cmd = "jupyter-book build"
36+
cwd = "book"
3337

3438
[feature.book.tasks.clean]
3539
description = "Remove the Jupyter Book build"
36-
cmd = "rm -rf book/_build"
40+
cmd = "jupyter-book clean && rm -rf ./_build"
41+
cwd = "book"
3742

38-
[feature.book.dependencies]
39-
jupyter-book = "0.15.1.*"
43+
[feature.book.tasks.start]
44+
description = "Serve the Jupyter Book as a website"
45+
cmd = "jupyter-book start"
46+
cwd = "book"
4047

41-
# macOS support for ROOT is currently not good
42-
[feature.book.target.linux-64.dependencies]
43-
root_base = ">=6.32.2,<7"
48+
[feature.book.dependencies]
49+
jupyter-book = ">=2.0.2,<3"
4450

4551
[feature.jupyterlite.tasks.build-lite]
4652
description = "Build JupyterLite version of book"
@@ -67,10 +73,11 @@ rm -rf book/jupyterlite.ipynb
6773
"""
6874

6975
[feature.jupyterlite.dependencies]
70-
jupyterlite = ">=0.5.0,<0.6"
71-
jupyterlite-pyodide-kernel = ">=0.5.0,<0.6"
72-
jupytext = ">=1.16.6,<2"
76+
jupyterlite = ">=0.7.0,<0.8"
77+
jupyterlite-pyodide-kernel = ">=0.7.0,<0.8"
78+
jupytext = ">=1.18.1,<2"
7379

7480
[environments]
81+
lab = ["lab"]
7582
book = ["book"]
7683
jupyterlite = ["jupyterlite"]

0 commit comments

Comments
 (0)