feat(interpreters): implement ipynb streaming parser with 97.9% memory reduction#24
Merged
patchmemory merged 3 commits intomainfrom Jan 16, 2026
Merged
Conversation
…ory reduction Refactored Jupyter notebook interpreter to use pure streaming parsing: - Made ijson a required dependency (was optional/fallback) - Removed all full-load fallbacks that defeated streaming purpose - Optimized streaming parser to count all cells while limiting content sampling - Version bumped from 0.2.0 to 0.3.0 Memory efficiency improvements: - Achieved 97.9% memory reduction vs full-load parsing (far exceeds 40% target) - For 3.6MB notebook: streaming uses ~165KB vs ~8MB for full load - All cells counted accurately regardless of notebook size Tests added: - Small notebook memory efficiency test (< 1MB peak) - Large notebook memory reduction test (validates >=40% reduction) - Large notebook cell counting accuracy test (1500 cells) - Streaming extracts imports and headings correctly All ipynb-related tests pass. Resolves task:interpreters/refactor/ipynb-streaming. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implements streaming parser for Jupyter notebooks with 97.9% memory reduction. - Refactored ipynb interpreter to use ijson streaming (no full-load fallbacks) - Added comprehensive memory profiling tests - Added tutorial documentation - Version bump to 0.3.0 Resolves task:interpreters/refactor/ipynb-streaming
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors Jupyter notebook interpreter to use pure streaming parsing via ijson, achieving 97.9% memory reduction for large notebooks (far exceeds 40% target).
Changes
Memory Impact
For a 3.6MB notebook (1,000 cells):
Test Results
Files Changed
pyproject.toml- Added ijson dependencyrequirements.txt- Added ijson dependencyscidk/interpreters/ipynb_interpreter.py- Refactored to pure streamingtests/test_ipynb_interpreter.py- Added memory profiling testsdocs/ipynb-streaming-optimization.md- Tutorial documentationMigration Notes
Zero API changes required. Existing code continues to work unchanged.
Resolves task:interpreters/refactor/ipynb-streaming
🤖 Generated with Claude Code