Skip to content

EgoDex: nbstripout hook to keep example notebooks output-free#49

Merged
everettVT merged 1 commit into
mainfrom
egodex-nbstripout-hook
Jul 7, 2026
Merged

EgoDex: nbstripout hook to keep example notebooks output-free#49
everettVT merged 1 commit into
mainfrom
egodex-nbstripout-hook

Conversation

@everettVT

Copy link
Copy Markdown
Contributor

What

Follow-up to #48. Keeps the example notebooks under datasets/ committed source-only, so run outputs can't creep back in.

  • Adds nbstripout to the lint extra.
  • Wires it into the repo's hand-rolled precommit hook: make precommit now runs nbstripout --verify on datasets/**/*.ipynb and fails if any carries stored outputs or execution counts.
  • Adds make strip-notebooks to clean them in place.
  • Re-serializes egodex_demo.ipynb in nbstripout's canonical form (indent 1, deterministic sequential cell ids) so the tool and the committed file agree — future strips are idempotent no-ops.

Scope

Deliberately scoped to datasets/. Four notebooks under notebooks/ (window_functions, data-ai-summit-2024, voice_ai_analytics, reddit) currently ship with rendered outputs, which looks intentional for conference/demo material — so this doesn't touch them or break commits on them. Easy to widen the DATASET_NOTEBOOKS glob later if we want repo-wide enforcement.

Verification

  • make precommit passes on the clean notebook; nbstripout --verify exits non-zero on a notebook with injected outputs (gate works).
  • Second make strip-notebooks is a no-op (idempotent); notebook stays valid nbformat with 24 unique cell ids.

🤖 Generated with Claude Code

Adds nbstripout (lint extra) and wires it into the hand-rolled precommit
hook: 'make precommit' now runs 'nbstripout --verify' on datasets/*.ipynb
and fails if any carries stored outputs or execution counts. 'make
strip-notebooks' cleans them in place. Scoped to datasets/ so the
conference/demo notebooks under notebooks/ keep their intentional
rendered outputs.

Re-serializes egodex_demo.ipynb in nbstripout's canonical form (indent 1,
deterministic sequential cell ids) so the tool and the committed file
agree — future strips are idempotent no-ops. Verified: --verify passes on
the clean notebook and rejects one with outputs; second strip is a no-op.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@everettVT everettVT merged commit b555353 into main Jul 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant