Skip to content

Phase 3: strict summary() defaults + deterministic tie-break - #9

Open
mewincaka wants to merge 1 commit into
kengggg:mainfrom
mewincaka:issue-8-d4ff330f
Open

Phase 3: strict summary() defaults + deterministic tie-break#9
mewincaka wants to merge 1 commit into
kengggg:mainfrom
mewincaka:issue-8-d4ff330f

Conversation

@mewincaka

Copy link
Copy Markdown
Collaborator

Fixes #8

Plan ID: d4ff330f

Summary

  • Conservative defaults: summary() no longer auto-infers columns. If date_cols, numeric_cols, and categorical_cols are all omitted, it returns only n per group.
  • top_k default: Changed from 5 to 3 per spec.
  • Deterministic categorical tie-break: count descending, then string(value) ascending.
  • Tests: Rewrote tests/test_summary.py with 22 tests covering: by/no-by, default-only-n, date coercion, numeric quartiles, categorical tie-breaking, wide output, missingness.
  • Docs: Updated README with conservative-defaults examples.

Local checks

ruff check epydem/ tests/   -> All checks passed!
pytest tests/ -v             -> 34 passed, 0 failed

Test plan

  • by vs no-by grouping
  • Default-only-n behavior (conservative defaults)
  • Date coercion (valid, invalid, all-invalid, missingness)
  • Numeric quartiles (basic stats, missing, all-missing)
  • Categorical tie-breaking (count desc, alpha asc, <NA> token)
  • Wide output pivot
  • Missingness edge cases
  • ruff clean
  • Full test suite passes (34/34)

🤖 Generated with Claude Code

…ie-break

- Change top_k default from 5 to 3 per spec
- Remove auto-inference of columns (conservative defaults): if no
  column lists specified, summary() returns only n per group
- Add deterministic categorical tie-breaking: count desc, then
  string(value) asc
- Rewrite tests/test_summary.py with full coverage: by/no-by,
  default-only-n, date coercion, numeric quartiles, categorical
  tie-breaking, wide output, missingness
- Update README with conservative-defaults examples

Fixes kengggg#8
Plan ID: d4ff330f

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mewincaka

Copy link
Copy Markdown
Collaborator Author

CI is green ✅ — ready for review: #9

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.

Implementing Phase 3 for summary()

1 participant