Skip to content

Commit 0cb518f

Browse files
committed
MNT: Fix some broken deprecations
The `ngrids` deprecation was missing the version, and style registration incorrectly included the micro version.
1 parent 3796813 commit 0cb518f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/matplotlib/patches.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,10 +2382,9 @@ def pprint_styles(cls):
23822382

23832383
@classmethod
23842384
@_api.deprecated(
2385-
'3.10.0',
2385+
'3.10',
23862386
message="This method is never used internally.",
2387-
alternative="No replacement. Please open an issue if you use this."
2388-
)
2387+
alternative="No replacement. Please open an issue if you use this.")
23892388
def register(cls, name, style):
23902389
"""Register a new style."""
23912390
if not issubclass(style, cls._Base):

lib/mpl_toolkits/axes_grid1/axes_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def _get_col_row(self, n):
190190
return col, row
191191

192192
n_axes = property(lambda self: len(self.axes_all))
193-
ngrids = _api.deprecated(property(lambda self: len(self.axes_all)))
193+
ngrids = _api.deprecated('3.11')(property(lambda self: len(self.axes_all)))
194194

195195
# Good to propagate __len__ if we have __getitem__
196196
def __len__(self):

lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,3 +806,5 @@ def test_grid_n_axes():
806806
fig = plt.figure()
807807
grid = Grid(fig, 111, (3, 3), n_axes=5)
808808
assert len(fig.axes) == grid.n_axes == 5
809+
with pytest.warns(mpl.MatplotlibDeprecationWarning, match="ngrids attribute"):
810+
assert grid.ngrids == 5

0 commit comments

Comments
 (0)