Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This file was created automatically with `myst init --gh-pages` 🪄 💚
# Ensure your GitHub Pages settings for this repository are set to deploy with **GitHub Actions**.

name: MyST GitHub Pages Deploy
on:
push:
# Runs on pushes targeting the default branch
branches: [main]
env:
# `BASE_URL` determines, relative to the root of the domain, the URL that your site is served from.
# E.g., if your site lives at `https://mydomain.org/myproject`, set `BASE_URL=/myproject`.
# If, instead, your site lives at the root of the domain, at `https://mydomain.org`, set `BASE_URL=''`.
BASE_URL: /${{ github.event.repository.name }}

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install MyST
run: npm install -g mystmd
- name: Build HTML Assets
run: myst build --html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './_build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
19 changes: 1 addition & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
sudo Rscript -e 'install.packages("clue", repos="https://cloud.r-project.org")'
- name: Install Python dependencies
run: |
uv pip install -e ".[dev,docs,matching]" --system
uv pip install -e ".[dev,docs,matching,images]" --system
- name: Run tests with coverage
run: make test
- name: Upload coverage to Codecov
Expand All @@ -39,20 +39,3 @@ jobs:
file: ./coverage.xml
fail_ci_if_error: false
verbose: true
- name: Test documentation builds
run: make documentation
- name: Check documentation build
run: |
for notebook in $(find docs/_build/jupyter_execute -name "*.ipynb"); do
if grep -q '"output_type": "error"' "$notebook"; then
echo "Error found in $notebook"
cat "$notebook"
exit 1
fi
done
- name: Deploy documentation
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs/_build/html # The folder the action should deploy.
Original file line number Diff line number Diff line change
Expand Up @@ -57,40 +57,4 @@ jobs:
with:
file: ./coverage.xml
fail_ci_if_error: false
verbose: true

Build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install R and dependencies
run: |
sudo apt-get update
sudo apt-get install -y r-base r-base-dev libtirpc-dev
- name: Install R packages
run: |
sudo Rscript -e 'install.packages("StatMatch", repos="https://cloud.r-project.org")'
sudo Rscript -e 'install.packages("clue", repos="https://cloud.r-project.org")'
- name: Install dependencies
run: |
uv pip install -e ".[dev,docs,matching]" --system
- name: Build package
run: make build
- name: Test documentation builds
run: make documentation
- name: Check documentation build
run: |
for notebook in $(find docs/_build/jupyter_execute -name "*.ipynb"); do
if grep -q '"output_type": "error"' "$notebook"; then
echo "Error found in $notebook"
cat "$notebook"
exit 1
fi
done
verbose: true
52 changes: 52 additions & 0 deletions .github/workflows/pr_docs_changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Workflow that runs on code changes to a pull request.

name: Docs changes
on:
pull_request:
branches:
- main

paths:
- docs/**
- .github/**
workflow_dispatch:

jobs:
Test:
runs-on: ubuntu-latest
name: Test documentation builds
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install R and dependencies
run: |
sudo apt-get update
sudo apt-get install -y r-base r-base-dev libtirpc-dev
- name: Install R packages
run: |
sudo Rscript -e 'install.packages("StatMatch", repos="https://cloud.r-project.org")'
sudo Rscript -e 'install.packages("clue", repos="https://cloud.r-project.org")'
- name: Install dependencies
run: |
uv pip install -e ".[dev,docs,matching,images]" --system
- name: Install JB
run: uv pip install "jupyter-book>=2.0.0a0" --system
- name: Test documentation builds
run: make documentation
- name: Check documentation build
run: |
for notebook in $(find docs/_build/jupyter_execute -name "*.ipynb"); do
if grep -q '"output_type": "error"' "$notebook"; then
echo "Error found in $notebook"
cat "$notebook"
exit 1
fi
done
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,6 @@ celerybeat.pid
*.csv
*.jpg
*.html
*.h5
*.h5
# MyST build outputs
_build
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ format:
black . -l 79

documentation:
cd docs && jupyter-book build .
python docs/add_plotly_to_book.py docs/_build/html
cd docs && jupyter book clean . --all
cd docs && jupyter book build .
python docs/add_plotly_to_book.py docs/_build

build:
pip install build
Expand Down
5 changes: 5 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- bump: patch
changes:
added:
- Moved data loading utilities into utils and removed scf downloading functionality.
- Updated documentation to reflect the new structure and created a myst.yml file to deploy documentation with new jb v2.
1 change: 0 additions & 1 deletion docs/_static/__init__.py

This file was deleted.

2 changes: 0 additions & 2 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
format: jb-book
root: index

parts:

- caption: Models
chapters:
- file: models/imputer/index
Expand Down
Loading