Skip to content

Commit 9ff4409

Browse files
committed
MAINT: Update for MPL changes
1 parent 438adf5 commit 9ff4409

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

arch/tests/unitroot/test_unitroot.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
import scipy.stats as stats
1616
from statsmodels.datasets import macrodata, modechoice, nile, randhie, sunspots
1717
from statsmodels.regression.linear_model import OLS
18-
from statsmodels.tsa.stattools import _autolag, lagmat
18+
from statsmodels.tsa.stattools import lagmat
19+
try:
20+
from statsmodels.tsa.stattools import _autolag
21+
except:
22+
from statsmodels.tsa.stattools._stattools import _autolag
1923

2024
from arch.unitroot import ADF, DFGLS, KPSS, PhillipsPerron, VarianceRatio, ZivotAndrews
2125
from arch.unitroot.critical_values.dickey_fuller import tau_2010

arch/univariate/base.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@
4545
)
4646
from arch.utility.testing import WaldTestStatistic
4747

48+
MPL_LT_310 = False
4849
try:
4950
from matplotlib.figure import Figure
51+
from matplotlib import __version__
52+
from packaging.version import Version
53+
54+
MPL_LT_310 = Version(__version__) < Version("3.10.0")
5055
except ImportError:
5156
pass
5257

@@ -1642,7 +1647,7 @@ def hedgehog_plot(
16421647

16431648
fig, ax = plt.subplots(1, 1)
16441649
use_date = isinstance(self._dep_var.index, pd.DatetimeIndex)
1645-
plot_fn = ax.plot_date if use_date else ax.plot
1650+
plot_fn = ax.plot_date if use_date and MPL_LT_310 else ax.plot
16461651
x_values = np.array(self._dep_var.index)
16471652
if plot_mean:
16481653
y_values = np.asarray(self._dep_var)

0 commit comments

Comments
 (0)