Release v0.3.0: memory-bounded tokenization + DOD-O demo - #4
Merged
Conversation
- pipeline.tokenize() now tokenizes long recordings in fixed-size windows with both-side warmup context, keeping peak memory bounded by the chunk size instead of the recording length. Output is bit-identical to a single pass (verified by test_tokenize_chunked_matches_single_pass). embed_edf gains tokenize_chunk_seconds. - Add demo.ipynb: end-to-end sleep-staging example on the Dreem Open Dataset (DOD-O) — stream records, generate Hypnos embeddings, train a linear probe with subject-wise cross-validation. - README: link the demo from Usage. .gitignore: ignore demo data/ cache. - Bump version to 0.3.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`uvx ruff check/format .` lints .ipynb files; the demo notebook uses in-cell imports and `a; b` one-liners that don't fit the library's rules. Scope ruff to the package and tests via extend-exclude. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Bumps to 0.3.0 and ships the demo notebook. (0.2.0 was never published to PyPI — only the git tag exists — so we skip it; 0.2.0's channel-mapping changes are already on main and ship inside 0.3.0.)
Changes
pipeline.tokenize()tokenizes long recordings in fixed-size windows with both-side warmup context, so peak memory is bounded by the chunk size rather than the recording length (a full night was ~50 GB in one pass, ~7 GB chunked). Output is bit-identical to a single pass — covered bytest_tokenize_chunked_matches_single_pass.embed_edfgainstokenize_chunk_seconds.demo.ipynb— end-to-end sleep staging on the Dreem Open Dataset (DOD-O): stream records from Zenodo, generate Hypnos embeddings, train a subject-wise cross-validated linear probe. Linked from the README Usage section..gitignore: ignore the demo'sdata/(downloads + cached embeddings).Test
pytest tests/test_pipeline.py→ 6 passed (includes the new bit-exactness test).Release steps after merge
main.v0.3.0onmainand push (publish guard checks tag == pyproject version = 0.3.0).v0.3.0→ triggerspublish.yml→ PyPI.v0.2.0tag.🤖 Generated with Claude Code