Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f5a6899
Add a include_plotlyjs param to savefig (#69)
max-models Sep 4, 2026
7749cdd
Update README.qmd (#70)
max-models Sep 14, 2026
e5ea75a
Added a matplotlib parser (#71)
max-models Sep 26, 2026
960e44e
Xarray support (#72)
max-models Sep 26, 2026
3c3394c
Preparation for tikz support in plasma-plots (#73)
max-models Oct 1, 2026
a9fc26f
Fix docs build (#75)
max-models Oct 1, 2026
7734d87
Move the docs from Sphinx to starlight-theme (#76)
max-models Oct 20, 2026
8cf9666
Build the docs with starlight-theme v0.5.0 (#77)
max-models Oct 23, 2026
f31e1c6
Use ruff instead of black and isort (#78)
max-models Oct 27, 2026
0410ba5
Use the shared docs workflow and starlight-theme v0.6.0. (#79)
max-models Oct 29, 2026
30c16fa
Shorten the titles of the docs pages. (#80)
max-models Oct 29, 2026
cf21190
Remove the license. (#81)
max-models Oct 29, 2026
cdb8a3c
Build the docs with the theme's major tag v0. (#82)
max-models Oct 30, 2026
d4490e5
Keep Matplotlib's global rcParams when a canvas is drawn. (#83)
max-models Nov 6, 2026
ca8e397
Add tutorials for Matplotlib import and TikZ diagrams, and document i…
max-models Nov 6, 2026
e073efa
Web figures: theme-neutral Plotly JSON for the docs sites (#85)
max-models Nov 7, 2026
f965377
Keep an annotation's arrow when it has no text. (#86)
max-models Nov 7, 2026
374b6f9
Docs: web figures in the Plotly tutorial. (#87)
max-models Nov 7, 2026
bdf3521
Draw straight arrows with TikZ tips and map the diameter sign. (#88)
max-models Nov 7, 2026
966f4dd
Docs: live examples of web figures; room for axis titles in Plotly ou…
max-models Nov 7, 2026
1ca4a2f
Merge main (the squashed 0.2.0 release) into devel.
max-models Nov 8, 2026
2325ba8
Version 0.3.0.
max-models Nov 8, 2026
5b3bb75
Convert hatches to TikZ patterns. (#91)
max-models Nov 8, 2026
4ef67ba
Merge pull request #93 from max-models/release-0.3.0
max-models Nov 8, 2026
f426d35
Merge pull request #92 from max-models/merge-main-into-devel
max-models Nov 8, 2026
1086b13
Web figures: posters for light and dark pages; examples with captions…
max-models Nov 8, 2026
d632a5c
Draw a patch with holes as one even-odd TikZ path. (#94)
max-models Nov 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.ipynb filter=strip-notebook-output
*.ipynb filter=strip-notebook-output
2 changes: 1 addition & 1 deletion .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: |
coverage run -m pytest .
coverage report --sort=cover

- name: Test tutorials
run: |
jupyter nbconvert --to notebook --execute tutorials/*.ipynb \
Expand Down
82 changes: 36 additions & 46 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: Deploy docs to GitHub Pages
name: Docs

# The Astro + Starlight site in docs/: hand-written pages, the executed tutorials and the API
# reference. Built on every push and pull request with the shared workflow of
# max-models/starlight-theme; deployed to GitHub Pages from devel.
# The TikZ tutorials compile their figures with pdflatex and pgfplots, hence the LaTeX packages.

on:
push:
branches: ["devel", "main"] # TODO: Set to main only after release
branches: ["main", "devel"]
pull_request:
branches: ["main", "devel"]
workflow_dispatch:

permissions:
Expand All @@ -11,49 +18,32 @@ permissions:
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false
group: docs-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pandoc and LaTeX
run: |
sudo apt-get update
sudo apt-get install -y pandoc
# pdflatex with pgfplots: the tutorials compile tikzfigure figures
sudo apt-get install -y --no-install-recommends \
texlive-latex-base texlive-latex-extra texlive-pictures \
texlive-fonts-recommended lmodern

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
# tikzfigure 0.4.0 is not on PyPI yet: install it from GitHub (drop once released)
pip install "tikzfigure[vis] @ git+https://github.com/max-models/tikzfigure@c290f43ac1deb4a4ed3b5b40919f10d3a6b53e8b"
pip install ".[docs]"

- name: Build Sphinx docs
run: |
cd docs
make html

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload built docs
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html/

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
docs:
uses: max-models/starlight-theme/.github/workflows/docs.yml@v0
with:
apt-packages: "texlive-latex-base texlive-latex-extra texlive-pictures texlive-fonts-recommended lmodern"
# the example web figures of guides/web-figures, from scripts/web_figure_examples.py
pre-build: '"$DOCS_PYTHON" scripts/web_figure_examples.py'
# stable-branch: main # deploy the latest release at /<repo>/ and devel at /<repo>/dev/
# a notebook's outputs are numbered in order: in tutorial 07, 1.html is the Plotly
# preview and 2.png the first compiled TikZ figure
smoke-paths: |
getting-started/installation/index.html
getting-started/quickstart/index.html
guides/matplotlib-import/index.html
guides/web-figures/index.html
figures/waves.plotly.json
figures/heatmap.plotly.json
figures/packet.plotly.json
tutorials/index.html
tutorials/tutorial-01/index.html
tutorials/tutorial-07-tikz/index.html
tutorials/tutorial-17-xarray/index.html
tutorials/tutorial-07-tikz/2.png
tutorials/tutorial-01/tutorial_01.ipynb
api/maxplotlib/index.html
api/maxplotlib/canvas/index.html
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ jobs:
TWINE_USERNAME: __token__ # Use API token
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*

64 changes: 10 additions & 54 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,57 +24,6 @@ jobs:
./cloc --version
./cloc $(git ls-files)

black:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Code formatting with black
run: |
pip install "black[jupyter]"
black --check src/
black --check tutorials/

isort:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Code formatting with isort
run: |
pip install isort
isort --check src/
isort --check tutorials/

mypy:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Type check with mypy
continue-on-error: true
run: |
pip install mypy
mypy src/

prospector:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -103,11 +52,18 @@ jobs:
with:
python-version: "3.11"

- name: Lint with ruff
continue-on-error: true
- name: Linting with ruff (including import sorting)
run: |
pip install ruff
ruff check src/
ruff check .

- name: Code formatting with ruff
run: ruff format --check .

- name: Check statement order
run: |
pip install ssort
ssort --check --diff .

pylint:
runs-on: ubuntu-latest
Expand Down
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ instance/
# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
Expand Down Expand Up @@ -172,6 +170,11 @@ figures/
*.mp4
*.pkl
*.json
# except the docs site and Renovate config
!docs/package.json
!docs/package-lock.json
!docs/tsconfig.json
!renovate.json

# tex
*.aux
Expand All @@ -197,3 +200,5 @@ docs/superpowers/
docs/tutorials/
tutorials/*.txt
tutorials/*.png
tutorials/*.tikz
tutorials/*.html
30 changes: 21 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0 # Use the latest stable version
rev: v6.0.0
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files # Prevent giant files from being committed.
args: ["--maxkb=1000"]
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: check-toml # Attempts to load all TOML files to verify syntax.
- id: check-yaml # Attempts to load all yaml files to verify syntax.
args: ["--unsafe"]

args: [--maxkb=500]
exclude: ^(uv\.lock|docs/package-lock\.json)$ # generated lock files
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
rev: 0.9.1
hooks:
- id: nbstripout # remove jupyter notebook cell output
- id: nbstripout # strip jupyter notebook output
- repo: https://github.com/bwhmather/ssort
rev: 0.17.0
hooks:
- id: ssort # order statements so names are defined before they are used
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.3
hooks:
- id: ruff-check # lint, including import sorting (the I rules)
args: [--fix]
- id: ruff-format
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# The documentation site (docs/, Astro + Starlight).
# Notebook tool: starlight-notebooks, from @max-models/starlight-theme (docs/node_modules).
PYTHON ?= .venv/bin/python
DOCS_ENV = DOCS_PYTHON=$(abspath $(PYTHON))
NOTEBOOKS = cd docs && $(DOCS_ENV) npx starlight-notebooks

.PHONY: help docs-install docs-notebooks docs-dev docs-build docs-preview docs-clean

help: ## list the targets
@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-16s %s\n", $$1, $$2}'

docs-install: ## Python docs extra and the npm packages
$(PYTHON) -m pip install -e ".[docs]"
cd docs && npm ci

docs-notebooks: ## execute the changed tutorials and convert all of them (FORCE=1 reruns all)
$(NOTEBOOKS) execute $(if $(FORCE),--force,)
$(NOTEBOOKS) convert

docs-dev: ## live preview at http://localhost:4321/maxplotlib/
$(NOTEBOOKS) convert
cd docs && $(DOCS_ENV) DOCS_VALIDATE_LINKS=false npm run dev

docs-build: ## the static site in docs/dist, as in CI
$(NOTEBOOKS) convert
cd docs && npm run check:mdx && $(DOCS_ENV) npm run build

docs-preview: ## serve docs/dist
cd docs && npm run preview

docs-clean: ## remove generated pages, assets and build output
$(NOTEBOOKS) clean
rm -rf docs/dist docs/.astro
Loading
Loading