MAINT: drop removed scipy interp2d from TableDist (closes #8909)#9832
Merged
bashtage merged 1 commit intoJun 9, 2026
Merged
Conversation
…#8909) scipy.interpolate.interp2d was removed in SciPy 1.14.0 and now raises NotImplementedError when constructed. Its only use in statsmodels was the TableDist.poly2d cached property, which is undocumented, untested and not called anywhere (the interpolation TableDist actually uses goes through polyn/polyrbf/_critvals via interp1d and Rbf). Remove the dead poly2d method and the interp2d import so the module no longer depends on a removed SciPy API.
bashtage
approved these changes
Jun 9, 2026
Member
|
Looks right. I should have waited though for ci. |
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.
Closes #8909.
scipy.interpolate.interp2dgot removed in scipy 1.14, it just raises now:The only place we still import/use it is
TableDist.poly2d. Like Josef alreadysaid in #8909, that method isn't called anywhere (grep only finds its own
definition), it's not in the public api and there's no test for it. It also
looks like it was wrong to begin with - it passes
z=crit_tablewith shape(n_size, n_alpha)but interp2d wants(len(y), len(x)) = (n_alpha, n_size),so the axes were transposed.
So I just dropped the method and the import. Everything else on TableDist
(
prob/crit/crit3,_critvals,polyn,polyrbf) goes throughinterp1dand
Rbfand is untouched. Added a small test in test_tabledist.py.Ran it locally on scipy 1.17.1 / numpy 2.4.6 / pandas 3.0.3 / py3.13:
test_tabledist.py passes, and the lilliefors tests in test_diagnostic.py (the
real TableDist user) still pass.