refactor(clv): drop _prior suffix backwards-compat shim#2576
Draft
anevolbap wants to merge 2 commits into
Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2576 +/- ##
==========================================
- Coverage 93.90% 93.88% -0.02%
==========================================
Files 92 92
Lines 14089 14078 -11
==========================================
- Hits 13230 13217 -13
- Misses 859 861 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Remove the model_config rename loop in CLVModel.__init__ and the _rename_posterior_variables hook in build_from_idata, plus the matching tests. This was added in pymc-labs#1498 as a v1.0 deprecation and is one of the items flagged for removal in pymc-labs#1516. Also rename the _prior-suffixed keys in BetaGeoModel and ModifiedBetaGeoModel covariate convergence tests, and in the bg_nbg_covariates_test_issues dev notebook, which previously relied on the shim. Refs pymc-labs#1516
82b5a81 to
66ee144
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Summary
Removes the
_prior-suffix backwards-compat shim fromCLVModel. This was added in #1498 as a v1.0 deprecation. #1516 is the CLV-deprecations umbrella; this PR covers the first item there and leaves the rest as follow-ups.Three sites in
pymc_marketing/clv/models/basic.py:deprecated_keysrename loop in__init__._rename_posterior_variablescall insidebuild_from_idata._rename_posterior_variablesmethod itself.Two deprecation tests in
tests/clv/models/test_basic.pyare dropped (test_backwards_compatibility_with_old_config,test_deprecation_warning_on_old_config).Mechanical follow-up: covariate convergence tests in
test_beta_geo.pyandtest_modified_beta_geo.pystill passed_prior-suffixed keys (relying on the shim's silent rename). The same applied todocs/source/notebooks/clv/dev/bg_nbg_covariates_test_issues.ipynb. Renamed those keys to drop the suffix so they exercise the same priors directly.Note on timing
This is a hard breaking change: users still passing
_prior-suffixed keys will get a silent fallback to defaults, and saved netCDFs with_prior-suffixed posterior vars will not load cleanly. The original intent was a v1.0 cut. v1.0 (#2108) is still open. Can hold this PR until v1.0 is being cut, or merge now to start closing out the deprecations early. Preference?Remaining CLV deprecations tracked in #1516 (
clv.utils.clv_summary,ShiftedBetaGeoModelIndividualper #2157, unused distribution blocks per #2158, plotting parameter,fit(fit_method=...),CLVModel.build_with_data) are intentionally out of scope and would land as separate PRs.Test plan
pre-commit runon the touched files: passpytest tests/clv/: 313 passed, 17 skipped