Skip to content

Commit

Permalink
Add example notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsokol committed Jun 25, 2024
1 parent 65396a8 commit 58921c0
Show file tree
Hide file tree
Showing 5 changed files with 392 additions and 7 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
cache: 'pip'
- name: Install package
run: |
pip install -e .[tests]
pip install -e '.[tests]'
if [ "${{ matrix.pip_opts }}" != "" ]; then
pip install "${{ matrix.pip_opts }}" numba
fi
Expand All @@ -65,7 +65,7 @@ jobs:
cache: 'pip'
- name: Install package
run: |
pip install -e .[docs]
pip install -e '.[docs]'
- name: Run tests
run: |
sphinx-build -W -b html docs/ _build/html
Expand Down Expand Up @@ -103,10 +103,26 @@ jobs:
- name: Build and install Sparse
run: |
pip install -U setuptools wheel
python -m pip install '.[finch]' scipy
pip install '.[finch]' scipy
- name: Run examples
run: |
source ci/test_examples.sh
notebooks:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Build and install Sparse
run: |
pip install -e '.[notebooks]'
- name: Run notebooks
run: |
source ci/test_notebooks.sh
array_api_tests:
strategy:
matrix:
Expand All @@ -130,10 +146,10 @@ jobs:
cache: 'pip'
- name: Install build and test dependencies from PyPI
run: |
python -m pip install pytest-xdist -r array-api-tests/requirements.txt
pip install pytest-xdist -r array-api-tests/requirements.txt
- name: Build and install Sparse
run: |
python -m pip install '.[finch]'
pip install '.[finch]'
- name: Run the test suite
env:
ARRAY_API_TESTS_MODULE: sparse
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ repos:
- id: no-commit-to-branch
- id: pretty-format-json
args: ["--autofix", "--no-ensure-ascii"]
exclude: ".ipynb"

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.9
Expand All @@ -24,3 +25,8 @@ repos:
types_or: [ python, pyi, jupyter ]
- id: ruff-format
types_or: [ python, pyi, jupyter ]

- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
1 change: 1 addition & 0 deletions ci/test_notebooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CI_MODE=True pytest -n 4 --nbmake --nbmake-timeout=600 ./examples/*.ipynb
Loading

0 comments on commit 58921c0

Please sign in to comment.