Skip to content

Commit

Permalink
MAINT: Update for MPL changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtage committed Jan 8, 2025
1 parent 438adf5 commit 32c372a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion arch/tests/unitroot/test_unitroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
import scipy.stats as stats
from statsmodels.datasets import macrodata, modechoice, nile, randhie, sunspots
from statsmodels.regression.linear_model import OLS
from statsmodels.tsa.stattools import _autolag, lagmat
from statsmodels.tsa.stattools import lagmat

try:
from statsmodels.tsa.stattools import _autolag
except:

Check notice

Code scanning / CodeQL

Except block handles 'BaseException' Note test

Except block directly handles BaseException.
from statsmodels.tsa.stattools._stattools import _autolag

Check warning on line 23 in arch/tests/unitroot/test_unitroot.py

View check run for this annotation

Codecov / codecov/patch

arch/tests/unitroot/test_unitroot.py#L22-L23

Added lines #L22 - L23 were not covered by tests

from arch.unitroot import ADF, DFGLS, KPSS, PhillipsPerron, VarianceRatio, ZivotAndrews
from arch.unitroot.critical_values.dickey_fuller import tau_2010
Expand Down
7 changes: 6 additions & 1 deletion arch/univariate/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@
)
from arch.utility.testing import WaldTestStatistic

MPL_LT_310 = False
try:
from matplotlib.figure import Figure
from matplotlib import __version__
from packaging.version import Version

MPL_LT_310 = Version(__version__) < Version("3.10.0")
except ImportError:
pass

Expand Down Expand Up @@ -1642,7 +1647,7 @@ def hedgehog_plot(

fig, ax = plt.subplots(1, 1)
use_date = isinstance(self._dep_var.index, pd.DatetimeIndex)
plot_fn = ax.plot_date if use_date else ax.plot
plot_fn = ax.plot_date if use_date and MPL_LT_310 else ax.plot
x_values = np.array(self._dep_var.index)
if plot_mean:
y_values = np.asarray(self._dep_var)
Expand Down

0 comments on commit 32c372a

Please sign in to comment.