Skip to content

Remove the deprecations scheduled for 0.8.0 - #229

Merged
shivamlalakiya merged 1 commit into
mainfrom
chore/remove-0.8-deprecations
Sep 24, 2026
Merged

shivamlalakiya merged 1 commit into
mainfrom
chore/remove-0.8-deprecations

Conversation

@shivamlalakiya

Copy link
Copy Markdown
Contributor

0.7.0 and 0.7.1 both shipped DeprecationWarnings saying these go in 0.8.0. That meets the "one full published minor of overlap" rule in RELEASING.md, so this clears them ahead of the 0.8.0 release. Three breaking changes, all listed under Unreleased in CHANGELOG.md and in the Deprecations section of the API reference.

Removed

  • philanthropy.utils.make_donor_dataset. Import it from philanthropy.datasets, which has been the canonical path since 0.7.0.
  • WealthScreeningImputerKNN(group_col_idx=...) and its group_imputers_ attribute. Per-group and global KNN fits were measured bit-identical, so the parameter bought nothing. Passing it is now a TypeError. tests/test_knn_group_stratification.py only exercised that parameter (its header said it would go in 0.8.0), so it is deleted, and the contract test in test_documented_contracts.py now asserts the removal instead.

Changed

  • FiscalYearGroupedSplitter(drop_repeat_donors=...) now defaults to True. Each test fold drops donors already seen in its training rows, which is the safe default for a static per-donor label. It needs groups as (n_samples, 2) (fiscal year, donor id). Code that passes fiscal years alone now gets a ValueError that names both fixes: add donor ids, or pass drop_repeat_donors=False for a time-varying target, which gives exactly the 0.7.x behaviour. The "warn" sentinel is gone, so repr now reads drop_repeat_donors=True.

Callers updated: scripts/leakage_experiment.py and scripts/real_data_leakage_experiment.py relied on the old default with a time-varying target, so they now pass drop_repeat_donors=False. The synthetic script still reproduces its documented numbers (whole-history 0.750, +0.126 inflation). Nothing else in the package, docs or notebooks relied on the default: notebooks 02 and 04 and render_leakage_chart.py already pass False.

Deprecation registry: the three rows are removed from tests/test_deprecations.py, so the AST meta-test still matches the two remaining shims (get_legacy_feature_names_out, removed in 0.9.0, and the SolicitationWindowTransformer alias, removed in 1.0.0).

Verified locally: make ci (2074 passed, coverage 98.49%), make riskcov, pytest --nbmake examples/notebooks (4 passed), the changed test files with -W error::DeprecationWarning, and mkdocs build --strict.

The version bump and pinning notebook 04's install line to >=0.8.0 come in a separate release PR.

0.7.0 and 0.7.1 both shipped DeprecationWarnings saying these go in 0.8.0,
which satisfies the "one full published minor" rule in RELEASING.md:

- philanthropy.utils.make_donor_dataset is gone; import it from
  philanthropy.datasets.
- WealthScreeningImputerKNN(group_col_idx=...) and group_imputers_ are gone.
  Per-group and global KNN fits were measured bit-identical, so the
  parameter bought nothing; passing it is now a TypeError.
- FiscalYearGroupedSplitter(drop_repeat_donors=...) now defaults to True.
  Fiscal years alone now raise a ValueError that names both fixes: pass
  donor ids as a second groups column, or drop_repeat_donors=False for a
  time-varying target. The two leakage experiment scripts relied on the old
  default and now pass False explicitly; the synthetic one still reproduces
  its documented +0.126.

The deprecation registry, the splitter tests and the reference page's
Deprecations section are updated to match.
@shivamlalakiya
shivamlalakiya merged commit 3ca6f79 into main Sep 24, 2026
15 checks passed
shivamlalakiya added a commit that referenced this pull request Sep 24, 2026
Bump pyproject.toml and CITATION.cff to 0.8.0, cut the dated [0.8.0] section in CHANGELOG.md with a Breaking heading for the three removals from #229, and point SECURITY.md and the API reference at 0.8.x.

Notebook 04 now installs the published wheel (philanthropy[viz]>=0.8.0), the same pattern as notebooks 02 and 03, so its Colab badge works once 0.8.0 is on PyPI. The tutorial page drops its install-from-GitHub note.

The changelog cut also folds a second '### Added' block that merge=union had left inside Unreleased into the first one, and moves a test-coverage bullet from Fixed to Added.
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.

1 participant