Refactor and fixes on predict+FI: shap multiclass, t2e FIs, transformer, warnings #347
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check notebooks are clean | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| jobs: | |
| check-notebooks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install nbstripout | |
| run: pip install nbstripout | |
| - name: Check notebooks have no outputs | |
| run: | | |
| # Get list of all .ipynb files tracked by git | |
| NOTEBOOKS=() | |
| while IFS= read -r -d '' nb; do | |
| NOTEBOOKS+=("$nb") | |
| done < <(git ls-files -z '*.ipynb') | |
| if [ ${#NOTEBOOKS[@]} -eq 0 ]; then | |
| echo "No notebooks found in repository" | |
| exit 0 | |
| fi | |
| echo "Checking notebooks for outputs..." | |
| printf '%s\n' "${NOTEBOOKS[@]}" | |
| # Run nbstripout in dry-run mode - fails if any notebooks would be modified | |
| nbstripout --dry-run "${NOTEBOOKS[@]}" || { | |
| echo "❌ ERROR: Some notebooks contain outputs!" | |
| echo "Please run 'nbstripout' on your notebooks before committing." | |
| exit 1 | |
| } | |
| echo "✅ All notebooks are clean (no outputs stored)" |