Skip to content

Commit 00674de

Browse files
authored
Add nbsphinx metadata to pre-executed notebooks. (#1226)
* Add nbsphinx metadata to pre-executed notebooks. * Auto-formatting.
1 parent 8ee3517 commit 00674de

22 files changed

+85
-56
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repos:
44
# This hook should always pass. It will print a message if the local version
55
# is out of date.
66
- repo: https://github.com/lincc-frameworks/pre-commit-hooks
7-
rev: v0.1.2
7+
rev: v0.2
88
hooks:
99
- id: check-lincc-frameworks-template-version
1010
name: Check template version
@@ -41,13 +41,13 @@ repos:
4141
description: Verify that pyproject.toml adheres to the established schema.
4242
# Verify that GitHub workflows are well formed
4343
- repo: https://github.com/python-jsonschema/check-jsonschema
44-
rev: 0.34.0
44+
rev: 0.36.1
4545
hooks:
4646
- id: check-github-workflows
4747
args: ["--verbose"]
4848
# Automatically sort the imports used in .py files
4949
- repo: https://github.com/pycqa/isort
50-
rev: 6.1.0
50+
rev: 7.0.0
5151
hooks:
5252
- id: isort
5353
name: Run isort
@@ -85,7 +85,7 @@ repos:
8585
]
8686
# Analyze the code style and report code that doesn't adhere.
8787
- repo: https://github.com/psf/black
88-
rev: 25.9.0
88+
rev: 26.1.0
8989
hooks:
9090
- id: black-jupyter
9191
name: Format code using black
@@ -108,32 +108,15 @@ repos:
108108
[
109109
"--ignore-missing-imports", # Ignore imports without type hints
110110
]
111-
# Make sure Sphinx can build the documentation while explicitly omitting
112-
# notebooks from the docs, so users don't have to wait through the execution
113-
# of each notebook or each commit. By default, these will be checked in the
114-
# GitHub workflows.
115-
- repo: local
111+
- repo: https://github.com/lincc-frameworks/pre-commit-hooks
112+
rev: v0.2.1
116113
hooks:
117-
- id: sphinx-build
118-
name: Build documentation with Sphinx
119-
entry: sphinx-build
120-
language: system
121-
always_run: true
122-
exclude_types: [file, symlink]
114+
- id: pre-executed-nb-never-execute
115+
name: Check pre-executed notebooks
116+
files: ^docs/tutorials/pre_executed/.*\.ipynb$
117+
verbose: true
123118
args:
124-
[
125-
"-M", # Run sphinx in make mode, so we can use -D flag later
126-
# Note: -M requires next 3 args to be builder, source, output
127-
"html", # Specify builder
128-
"./docs", # Source directory of documents
129-
"./_readthedocs", # Output directory for rendered documents
130-
"-T", # Show full trace back on exception
131-
"-E", # Don't use saved env; always read all files
132-
"-d", # Flag for cached environment and doctrees
133-
"./docs/_build/doctrees", # Directory
134-
"-D", # Flag to override settings in conf.py
135-
"exclude_patterns=tutorials/*,_build", # Exclude notebooks and build dir from pre-commit
136-
]
119+
["docs/tutorials/pre_executed/",]
137120
# Run unit tests, verify that they pass. Note that coverage is run against
138121
# the ./src directory here because that is what will be committed. In the
139122
# github workflow script, the coverage is run against the installed package

docs/tutorials/pre_executed/crossmatching.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2242,8 +2242,11 @@
22422242
"nbconvert_exporter": "python",
22432243
"pygments_lexer": "ipython3",
22442244
"version": "3.12.9"
2245+
},
2246+
"nbsphinx": {
2247+
"execute": "never"
22452248
}
22462249
},
22472250
"nbformat": 4,
22482251
"nbformat_minor": 5
2249-
}
2252+
}

docs/tutorials/pre_executed/custom_search.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,11 @@
909909
"nbconvert_exporter": "python",
910910
"pygments_lexer": "ipython3",
911911
"version": "3.12.3"
912+
},
913+
"nbsphinx": {
914+
"execute": "never"
912915
}
913916
},
914917
"nbformat": 4,
915918
"nbformat_minor": 5
916-
}
919+
}

docs/tutorials/pre_executed/des-gaia.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6070,8 +6070,11 @@
60706070
"nbconvert_exporter": "python",
60716071
"pygments_lexer": "ipython3",
60726072
"version": "3.10.14"
6073+
},
6074+
"nbsphinx": {
6075+
"execute": "never"
60736076
}
60746077
},
60756078
"nbformat": 4,
60766079
"nbformat_minor": 5
6077-
}
6080+
}

docs/tutorials/pre_executed/dp1-gaia-epoch-prop.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2026,8 +2026,11 @@
20262026
"nbconvert_exporter": "python",
20272027
"pygments_lexer": "ipython3",
20282028
"version": "3.13.9"
2029+
},
2030+
"nbsphinx": {
2031+
"execute": "never"
20292032
}
20302033
},
20312034
"nbformat": 4,
20322035
"nbformat_minor": 5
2033-
}
2036+
}

docs/tutorials/pre_executed/explode_lightcurves.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,11 @@
761761
"nbconvert_exporter": "python",
762762
"pygments_lexer": "ipython2",
763763
"version": "2.7.6"
764+
},
765+
"nbsphinx": {
766+
"execute": "never"
764767
}
765768
},
766769
"nbformat": 4,
767770
"nbformat_minor": 5
768-
}
771+
}

docs/tutorials/pre_executed/index_table.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,8 +1678,11 @@
16781678
"nbconvert_exporter": "python",
16791679
"pygments_lexer": "ipython3",
16801680
"version": "3.12.3"
1681+
},
1682+
"nbsphinx": {
1683+
"execute": "never"
16811684
}
16821685
},
16831686
"nbformat": 4,
16841687
"nbformat_minor": 5
1685-
}
1688+
}

docs/tutorials/pre_executed/join_catalogs.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,11 @@
466466
"nbconvert_exporter": "python",
467467
"pygments_lexer": "ipython3",
468468
"version": "3.11.13"
469+
},
470+
"nbsphinx": {
471+
"execute": "never"
469472
}
470473
},
471474
"nbformat": 4,
472475
"nbformat_minor": 2
473-
}
476+
}

docs/tutorials/pre_executed/manual_verification.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,11 @@
528528
"nbconvert_exporter": "python",
529529
"pygments_lexer": "ipython3",
530530
"version": "3.11.13"
531+
},
532+
"nbsphinx": {
533+
"execute": "never"
531534
}
532535
},
533536
"nbformat": 4,
534537
"nbformat_minor": 2
535-
}
538+
}

docs/tutorials/pre_executed/map_partitions.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,8 +1317,11 @@
13171317
"nbconvert_exporter": "python",
13181318
"pygments_lexer": "ipython3",
13191319
"version": "3.13.11"
1320+
},
1321+
"nbsphinx": {
1322+
"execute": "never"
13201323
}
13211324
},
13221325
"nbformat": 4,
13231326
"nbformat_minor": 5
1324-
}
1327+
}

0 commit comments

Comments
 (0)