Repository navigation
test: add 10 tests for checkpoints module - #7
hai-pilgrim wants to merge 1 commit into
Conversation
…et_state_dict) print_state_dict_shapes: - prints each key - keys appear in sorted order - empty dict prints nothing - tensor shape appears in output - single-key dict works get_state_dict: - returns a dict - all safetensors keys are present in result - tensor values are returned by reference - empty checkpoint returns empty dict - safe_open called with framework='pt' and device='cpu' Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Triage note from idle-cycle review: the single commit Skipping this PR for merge because of the scope conflation. Two clean paths forward:
The test file itself is clean — 10 well-mocked tests for |
|
Triaged during hivemind sweep. Stale + conflicting — opened 2026-03-28/29, main has moved substantially since:
|
|
Re-landed as draft PR #12. test_checkpoints.py was a new file (no conflict), but the commit had a |
|
Superseded by #12 (merged). Markus cherry-picked the test file cleanly off your stale branch, fixed 2 ruff F401s, and re-landed it without the Co-Authored-By trailer that violated repo convention. Thanks for the contribution! 🙏 |
Summary
Adds unit tests for
markutils.checkpoints, covering bothprint_state_dict_shapesandget_state_dict. All tensor I/O is mocked — no real.safetensorsfiles required.Tests added (
tests/test_checkpoints.py)print_state_dict_shapes.shapevalue appears in outputget_state_dictdict{}safe_openis called withframework="pt"anddevice="cpu"Test plan
All 10 tests pass with
uv run pytest tests/test_checkpoints.py.🤖 Generated with Claude Code