Notebook 빨리 썩어
Jupyter notebook 은 ML repo 어디에나 — 탐색 분석, 학습 스크립트, 데모 플로우, 튜토리얼 페이지. Commit 순간 썩기 시작: output 오래되고, deps 이동, '내 노트북에서 그냥 됨' 상태 나이 들어.
Notebook 을 코드처럼. CI 에서 test.
도구
- papermill — 매개변수화된 입력으로 notebook end-to-end 실행. 출력은 모든 cell 돈 새 notebook.
- pytest --nbmake — notebook 을 pytest test 로 실행.
- jupyter nbconvert --execute — 내장, 단순.
- nbqa — notebook 에 ruff / black / mypy 실행.
뭘 단언
- Notebook 이 에러 없이 완료까지 돔.
- 특정 cell 이 기대 output 생산 (papermill + 작은 test 스크립트).
- Lint / format 깨끗 (nbqa + ruff).
- Output 은 commit 전 strip (
nbstripout또는 pre-commit hook) — diff 가 읽기 가능하게.