Skip to content

types: finish the mypy ratchet across experimental, models, and preprocessing - #177

Merged
shivamlalakiya merged 1 commit into
mainfrom
types/finish-mypy-ratchet-models-preprocessing
Sep 6, 2026
Merged

types: finish the mypy ratchet across experimental, models, and preprocessing#177
shivamlalakiya merged 1 commit into
mainfrom
types/finish-mypy-ratchet-models-preprocessing

Conversation

@shivamlalakiya

Copy link
Copy Markdown
Contributor

Summary

No behavior change: every edit is a type annotation. Verified with make ci, make riskcov, and the ratchet probe from #166 (appending an unannotated function now fails mypy, confirmed then reverted).

This PR only covers the mypy-ratchet item. A pass over plan.md (gitignored, not part of this diff) found that the rest of the JOSS-prep checklist's code-shaped items — make_donor_panel, the three CI-executed notebooks, the real-data docs page, the "which estimator" table, YAML issue forms, the coverage-badge link, pypi-smoke.yml — were already shipped in earlier PRs (#161, #162, #165, #167, #170, #172, #173). This is genuinely the last code-only item left in that list; everything else remaining is non-code (preprint, Discussion post, outreach).

Test plan

…ocessing

Annotates the last 129 unannotated functions across the estimator surface
(experimental/_uplift.py, all 9 models/*.py, all 12 preprocessing/*.py).
`fit` returns a per-class TypeVar bound to the class rather than a string
literal, so a subclass's fit no longer reports its parent's type;
`__sklearn_tags__` returns sklearn's public Tags dataclass (scikit-learn>=1.6,
the declared floor).

With every subpackage covered, collapses `[[tool.mypy.overrides]]` into a
top-level `disallow_untyped_defs = true`, so a newly-added unannotated
function anywhere in philanthropy fails CI instead of quietly enlarging the
backlog. Closes #166.
@shivamlalakiya
shivamlalakiya merged commit 7c4c5ab into main Sep 6, 2026
15 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.

Finish the mypy ratchet: annotate model_selection, experimental, cli, models, preprocessing

1 participant