Skip to content

Commit 8854996

Browse files
Port pure Sphinx site to Jupyter Book 1 (#846)
* Add advanced topics to _toc * Working through optimization notebook * Add script for putting examples into own notebook. * Fix parsing of mathematical optimization notebook. * Fix up parsing of some notebooks. * Fix execution in some language notebooks. * Edits to Scipy Sparse. * Attempted edit to solve Sphinx build error. * Working through pages. * Maybe fix sparse solvers page. * Another fix to solvers page. * Remove image specifiers from guide * Remove unused import * Another couple of pages with wrong syntax. * Remove ipython directive, fix table * Exceptions rewrite without ipython directives. * Remove ipython directive. * Other uses if ipython * ipython pygments syntax * AUTHORS.md is a page; don't ignore. * Rename substitution. * Clean up basic_types * Fix functions * Move toctree into _toc * Edit some warnings, for build fix * Conmment out image directives. * Reprocess image blocks for parsing. * add sandbox file with early notes * Fix build by removing stray LaTeX markup. * Add editing instructions * Work through advanced operations * Fix up Numpy exercises * Remove now-redundant gallery. * Rename exercises to avoid clash with headings * Rework a few more notebooks * first adapted optimization graphs are in * Docstrings for examples2nb * Undo commenting of matplotlib example blocks * Replace non-example image usage. * Some replacements in .md files. * Script to run regex over file Modify by changing regex in file. * Modify examples2nb to allow default examples. * Tweak parsing, add writing of example notebooks. * Literal for UnivariateSpline * Rework script. * add encoding check to examples script to sidestep error * first pass at adaptive gradient descent adaptation * first pass at all graphs on optimization page * first pass at all graphs on optimization page * Nearer final version of script * Minor refactor * Typo * Fix up stats-interpolate exercises * Working on the scikit-learn page. * Set default notebook encoding. * Remove prints * Finish scikit-learn page first draft. * Finish first pass edits of scikit-learn page. * Recursive search for examples and add ability to specify more than one directory to search for examples. * Add matplotlib examples notebook. * Starting on Matplotlib tutorial. * Working through Matplotlib foothills. * update plotting code and add cell tags * remove junk and update _scripts/ * Swap new optimization notebook for old. * Finish up Matplotlib page. * Remove examples page; now consumed. * Fix build of debugging page * Drop reference to sphinx-gallery in examples. * Patchup of scikit-image page There are many plots that need converting, but as we are rewriting this page, let's leave those for now. Look for `auto_examples` to find plots to convert. * Work through statistics page * Add stats examples notebook. * Add Scipy examples * Use ::: syntax for include. * Remove "> " and some other edits. * Run post_parser having stripped preceding "> " * Remove stray "^>" markers. * Working through Scipy page. * Working through examples. * Continuing Scipy page. * Finish up Scipy page. * Tweaks to improve build. * Clean up some build failures * Remove now-unused CSS * Fixing some failures. * Restore advanced_numpy page Truncated by test edit. * Move Matplotlib illustrations into own file. * Replace ```{image} with ::: {image} in Numpy page. * Update Numpy pages, fixing exercises. * Add title to about page To silence various warnings. * Fix some references. * Add data file for Numpy exercise * Move note heading to block of note. * Fix some scipy page references * Use glue to pick up spectrogram example figures. * Put Scipy FFT code back into examples. * Try explicit title for about page. * Remove reference to Numpy 1.13 It's too old now. * Clean up IPython blocks Change from python to ipython, restore prompts. * Various reference fixes, URL fix. * Fix some more reference errors. * Clean up Python language section * Clear up _toc * Various fixes to build. * Drop test workflow, install build deps for lint * Pre-commit changes. * Install build requirements for pages * Remove unused _course.yml * Add todo file. * remove substitutions, fix captions and remove list tables from optimization page * A couple of workflow fixes Including nasty dependency resolution problem for pages. * Todo style fixes. * make intro more consistent with original, catch typo * remove junk * fix missing caption on optimization page * Remove duplicate helper directory. * Ruff suggestions * Satisfy mypy * Fix trailing whitespace. * Add Linting make target. * finish types page proofing, small changes * Fix build directory * proof control page, small changes * proofing control page, more small edits * proof functions page, small edits * Adapt processing script to error processing * Minor edits for intro page Incidental to debugging processing script. * Removing, fixing some quote markers * implement most of Matthew's comments * small edits to numpy array page * Linter changes * Fix tests to adapt to change in function API * Neater way of getting first following node. * Add test target. * Adapt CONTRIBUTING to content. * Move pre-commit into build_requirements. * Reformat file with Ruff * Ignore generated file. * Refactor functions, add exercises[ and remove exercises from intro/scipy/solutions * Rework control flow, add exercise. * Note to look for exercises * Remove last "> " remnants. * Rework standard library page, clean solutions. * Remove done todo item. * Restore previous deletion of sidebar directives * Remove some rst markup * Working through exercises Moving to sphinx-exercise * Fix path to example data file. * Exercises in optimization page. * Exercises in optimization page. * Complete removal of old exercise markers. * Remove last ReST directives. * Reworking skimage page. * Finish up port of scikit-image page. * Note completed task, add new task. * fix tables * remove junk image * missing . * Remove generated file from repo. * Don't process .ipynb_checkpoints * Label some generated files. * Remove .ipynb_checkpoint file. * make clean removes .ipynb_checkpoints directories * Remove a :math: reference. * Replace :ref: with {ref} * Replace :func: with {func} * Replace :mod: with {mod} * Replace :class: with {class} * Add intersphinx mappings. * Fix scikit-image intersphinx mappings. * Remove module reference that wasn't a module ref. * Fix new reference label failure Exposed by fixing :ref: -> {ref} * Fix some download links. * Fix a few class references. * Remove extra space at beginning of line. * -rf to avoid error deleting directories. * Point to my copy for now. * Remove use of <br> now I've found list-table * Hide some inputs * Full path for interact buttons. * Refactor optimization page to list-tables and glue The plots looked good, but the code was getting complicated and hard to read on the main page. * Remove now-uneeded header code in math-opt nbook. * Fix repeated plot example; add plot code links. * Fix Scipy module table. * Change guide from ReST example to Markdown * Add myst_nb to requirements We need it for building pages with "glue" references. * Use glue for camel graphic * Note mathematical optimization done. * Remove references to `rst` files. * Remove last ".. " directive reference. * Ignore joblib directories * Update PRESENTING to be agnostic about build. * We no longer use sphinx-gallery * Remove conf.py * Run compare_optimizers and commit rebuilt pkl * Ruff reformat * Fix a title. * Fix link to plot. * Rending -> rendering * Initial port to Myst Markdown text format * Generalize notebook processing for input formats. * Add antialiased back to MPL quick ref table. * Add prefix to interact URL * Remove subdirectory spec for repository This is not the subdirectory for the URL, but for the local files. * Fix references to "md:myst" - should be "myst" * Refactor processing to allowe remove-cell drop * Lint * Move regex around * Add Myst jupyterlab / jupyterlite extension. * Turn of processing of admonitions. * Drop out glue directives. * More complete message for glue refs. * Refactor process_admonitions * Clean joblib files * Some tweaks to the TOC * Add TOC to front page. * Small capitalization and style fixes. * Fix inclusion of metadata in included pages. * Remove reference to PDF version Does anyone use these? * Add first tests. * Explain testing, more on post-processing * Allow Makefile clean commands to fail. * Move Jupyterlab-myst to requirements. * Satisfy linter. * Note default True for proc_admonitions * Remove typo from README.md * Decapitalize some admonition directives * Remove stub index pages from _toc, leave as redirects. * Emphasise table captions * Turn bold text into headings * Switch URLs back to main site * Maybe fix circle CI * Try further fixes to circle-ci * Refactor requirements Previous requirements forcing older versions of jupyter-book. * Revert "Switch URLs back to main site" This reverts commit 6953285. * Pin to Jupyter Book 1. * Removed forced upgrade of jupyter-book Now that would get us Jupyter Book 2. --------- Co-authored-by: Peter Rush (Psychology) <[email protected]>
1 parent 9e2eefc commit 8854996

File tree

228 files changed

+30702
-41224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+30702
-41224
lines changed

.circleci/config.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,11 @@ version: 2.1
33
jobs:
44
build:
55
docker:
6-
- image: cimg/python:3.12
6+
- image: cimg/python:3.13
77

88
steps:
99
- checkout
1010

11-
- run:
12-
name: Install TeX
13-
command: |
14-
sudo apt update
15-
sudo apt install -y \
16-
dvipng \
17-
latexmk \
18-
texlive-latex-extra \
19-
texlive-fonts-extra \
20-
texlive-extra-utils
21-
2211
- restore_cache:
2312
keys:
2413
- pip-cache-v1
@@ -27,7 +16,7 @@ jobs:
2716
name: Install Python dependencies
2817
command: |
2918
pip install --upgrade --user pip
30-
pip install --user -r requirements.txt
19+
pip install --user -r build_requirements.txt
3120
pip list
3221
3322
- save_cache:
@@ -40,12 +29,7 @@ jobs:
4029
command: |
4130
# NOTE: bad interaction w/ blas multithreading on circleci
4231
export OMP_NUM_THREADS=1
43-
make pdf
44-
make html # FIX: check that failing examples produce failure
45-
cp \
46-
ScientificPythonLectures.pdf \
47-
ScientificPythonLectures-simple.pdf \
48-
build/html/_downloads/
32+
make web # FIX: check that failing examples produce failure
4933
5034
- store_artifacts:
51-
path: build/html
35+
path: _build/html

.codespellrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[codespell]
2+
skip = .git,*.pdf,*.svg,*.csv
3+
ignore-words-list = trough,remainers,befores

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install packages
2828
run: |
2929
pip install --upgrade pip wheel setuptools
30-
pip install -r requirements.txt
30+
pip install -r build_requirements.txt
3131
pip list
3232
3333
- name: Lint

.github/workflows/pages.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,21 @@ jobs:
2727
- name: Install Python dependencies
2828
run: |
2929
python -m pip install --upgrade pip wheel setuptools
30-
python -m pip install -r requirements.txt
30+
python -m pip install -r build_requirements.txt
3131
32-
- name: "Build PDF & HTML"
32+
- name: "Build HTML"
3333
run: |
34-
make pdf
3534
make html
36-
mv \
37-
ScientificPythonLectures.pdf \
38-
ScientificPythonLectures-simple.pdf \
39-
build/html/_downloads
40-
echo -n 'lectures.scientific-python.org' > build/html/CNAME
41-
touch build/html/.nojekyll
35+
echo -n 'lectures.scientific-python.org' > _build/html/CNAME
36+
touch _build/html/.nojekyll
4237
4338
- name: Deploy
4439
uses: peaceiris/actions-gh-pages@v4
4540
with:
4641
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
47-
external_repository: scipy-lectures/lectures.scientific-python.org
42+
# external_repository: scipy-lectures/lectures.scientific-python.org
4843
publish_branch: gh-pages
49-
publish_dir: ./build/html
44+
publish_dir: ./_build/html
5045
force_orphan: true
5146
user_name: "github-actions[bot]"
5247
user_email: "github-actions[bot]@users.noreply.github.com"

.github/workflows/test.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ jobs:
2828

2929
- name: Install packages
3030
run: |
31-
python -m pip install --upgrade pip wheel setuptools
32-
python -m pip install -r requirements.txt
31+
python -m pip install -r test_requirements.txt
3332
python -m pip list
3433
35-
- name: Test lectures
36-
run: make test
34+
- name: Test
35+
run: |
36+
# Avoid deprecation error.
37+
export JUPYTER_PLATFORM_DIRS=1
38+
jupyter --paths
39+
40+
make test

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,17 @@ airfares.txt
4545
wages.txt
4646
ScientificPythonLectures-simple.pdf
4747
ScientificPythonLectures.pdf
48+
.ipynb_checkpoints/
49+
__pycache__/
50+
.ok_storage
51+
*.ipynb
52+
*.orig
53+
node_modules/
54+
.jupyterlite.doit.db
55+
advanced/advanced_numpy/test.png
56+
packages/scikit-image/cat.png
57+
advanced/advanced_numpy/test_recolored.png
58+
advanced/advanced_numpy/test_red.png
59+
intro/language/junk.txt
60+
intro/language/test.pkl
61+
joblib/

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ repos:
4545
additional_dependencies:
4646
- types-aiofiles
4747
- types-requests
48+
- types-docutils
49+
- types-PyYAML
4850
- pandas-stubs
4951
- types-pillow
5052
- matplotlib
@@ -56,6 +58,8 @@ repos:
5658
| .*/setup.*\.py$
5759
| .*/demo.py$
5860
| .*/auto_examples/
61+
| _scripts/examples2nb.py$
62+
| _scripts/post_parser.py$
5963
| advanced/mathematical_optimization/examples/plot_gradient_descent\.py$
6064
| advanced/mathematical_optimization/examples/helper/compare_optimizers\.py$
6165
| advanced/advanced_numpy/examples/view-colors\.py$

0 commit comments

Comments
 (0)