Skip to content

MAINT: drop removed scipy interp2d from TableDist (closes #8909)#9832

Merged
bashtage merged 1 commit into
statsmodels:mainfrom
maxime2476:fix/tabledist-remove-interp2d
Jun 9, 2026
Merged

MAINT: drop removed scipy interp2d from TableDist (closes #8909)#9832
bashtage merged 1 commit into
statsmodels:mainfrom
maxime2476:fix/tabledist-remove-interp2d

Conversation

@maxime2476

Copy link
Copy Markdown
Contributor

Closes #8909.

scipy.interpolate.interp2d got removed in scipy 1.14, it just raises now:

NotImplementedError: `interp2d` has been removed in SciPy 1.14.0.

The only place we still import/use it is TableDist.poly2d. Like Josef already
said 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_table with 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 through interp1d
and Rbf and 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.

…#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
bashtage merged commit 899f4a4 into statsmodels:main Jun 9, 2026
1 check was pending
@bashtage

bashtage commented Jun 9, 2026

Copy link
Copy Markdown
Member

Looks right. I should have waited though for ci.

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.

MAINT: scipy interp2d is deprecated/removed

2 participants