Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example notebook #709

Merged
merged 2 commits into from
Jun 26, 2024
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
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.10
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
Loading