8000 Remove more deprecations. · matplotlib/matplotlib@7e89381 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e89381

Browse files
committed
Remove more deprecations.
1 parent 7db82ea commit 7e89381

File tree

10 files changed

+21
-68
lines changed

10 files changed

+21
-68
lines changed

doc/api/axes_api.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ non-rectilinear Axes.
587587
Axes.get_xaxis_transform
588588
Axes.get_yaxis_transform
589589
Axes.get_data_ratio
590-
Axes.get_data_ratio_log
591590

592591
Axes.get_xaxis_text1_transform
593592
Axes.get_xaxis_text2_transform
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
``Axes`` methods and properties
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
- ``axes.Axes.get_data_ratio_log``
5+
- ``axes.SubplotBase.rowNum``; use ``ax.get_subplotspec().rowspan.start``
6+
instead
7+
- ``axes.SubplotBase.colNum``; use ``ax.get_subplotspec().colspan.start``
8+
instead
9+
10+
``dates`` functions
11+
~~~~~~~~~~~~~~~~~~~
12+
- ``dates.mx2num``
13+
14+
``quiver`` methods
15+
~~~~~~~~~~~~~~~~~~
16+
17+
- ``quiver.QuiverKey.quiverkey_doc`` has been removed; use
18+
``quiver.QuiverKey.__init__.__doc__`` instead.

doc/missing-references.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,6 @@
191191
"backend_qt5.FigureCanvasQTAgg": [
192192
"doc/api/prev_api_changes/api_changes_2.2.0.rst:210"
193193
],
194-
"datetime": [
195-
"lib/matplotlib/dates.py:docstring of matplotlib.dates.mx2num:2"
196-
],
197194
"dateutil.rrule.rrulebase": [
198195
"<external>/rrule.py:docstring of matplotlib.dates.rrule:1"
199196
],

lib/matplotlib/axes/_base.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import inspect
44
import itertools
55
import logging
6-
import math
76
from numbers import Real
87
from operator import attrgetter
98
import types
@@ -1602,23 +1601,6 @@ def get_data_ratio(self):
16021601
ysize = max(abs(tymax - tymin), 1e-30)
16031602
return ysize / xsize
16041603

1605-
@_api.deprecated("3.2")
1606-
def get_data_ratio_log(self):
1607-
"""
1608-
Return the aspect ratio of the raw data in log scale.
1609-
1610-
Notes
1611-
-----
1612-
Will be used when both axis are in log scale.
1613-
"""
1614-
xmin, xmax = self.get_xbound()
1615-
ymin, ymax = self.get_ybound()
1616-
1617-
xsize = max(abs(math.log10(xmax) - math.log10(xmin)), 1e-30)
1618-
ysize = max(abs(math.log10(ymax) - math.log10(ymin)), 1e-30)
1619-
1620-
return ysize / xsize
1621-
16221604
def apply_aspect(self, position=None):
16231605
"""
16241606
Adjust the Axes for a specified data aspect ratio.

lib/matplotlib/axes/_subplots.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,6 @@ def update_params(self):
9898
# Now a no-op, as figbox/numRows/numCols are (deprecated) auto-updating
9999
# properties.
100100

101-
@_api.deprecated("3.2", alternative="ax.get_subplotspec().rowspan.start")
102-
@property
103-
def rowNum(self):
104-
return self.get_subplotspec().rowspan.start
105-
106-
@_api.deprecated("3.2", alternative="ax.get_subplotspec().colspan.start")
107-
@property
108-
def colNum(self):
109-
return self.get_subplotspec().colspan.start
110-
111101
@_api.deprecated("3.4", alternative="ax.get_subplotspec().is_first_row()")
112102
def is_first_row(self):
113103
return self.get_subplotspec().rowspan.start == 0

lib/matplotlib/dates.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@
166166
from matplotlib import _api, cbook, ticker, units
167167

168168
__all__ = ('datestr2num', 'date2num', 'num2date', 'num2timedelta', 'drange',
169-
'epoch2num', 'num2epoch', 'mx2num', 'set_epoch',
170-
'get_epoch', 'DateFormatter',
169+
'epoch2num', 'num2epoch', 'set_epoch', 'get_epoch', 'DateFormatter',
171170
'ConciseDateFormatter', 'IndexDateFormatter', 'AutoDateFormatter',
172171
'DateLocator', 'RRuleLocator', 'AutoDateLocator', 'YearLocator',
173172
'MonthLocator', 'WeekdayLocator',
@@ -1783,23 +1782,6 @@ def num2epoch(d):
17831782
return np.asarray(d) * SEC_PER_DAY - dt
17841783

17851784

1786-
@_api.deprecated("3.2")
1787-
def mx2num(mxdates):
1788-
"""
1789-
Convert mx :class:`datetime` instance (or sequence of mx
1790-
instances) to the new date format.
1791-
"""
1792-
scalar = False
1793-
if not np.iterable(mxdates):
1794-
scalar = True
1795-
mxdates = [mxdates]
1796-
ret = epoch2num([m.ticks() for m in mxdates])
1797-
if scalar:
1798-
return ret[0]
1799-
else:
1800-
return ret
1801-
1802-
18031785
def date_ticker_factory(span, tz=None, numticks=5):
18041786
"""
18051787
Create a date locator with *numticks* (approx) and a date formatter

lib/matplotlib/pylab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from matplotlib.dates import (
1919
date2num, num2date, datestr2num, drange, epoch2num,
20-
num2epoch, mx2num, DateFormatter, IndexDateFormatter, DateLocator,
20+
num2epoch, DateFormatter, IndexDateFormatter, DateLocator,
2121
RRuleLocator, YearLocator, MonthLocator, WeekdayLocator, DayLocator,
2222
HourLocator, MinuteLocator, SecondLocator, rrule, MO, TU, WE, TH, FR,
2323
SA, SU, YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY,

lib/matplotlib/quiver.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,6 @@ def contains(self, mouseevent):
374374
return True, {}
375375
return False, {}
376376

377-
@_api.deprecated("3.2")
378-
@property
379-
def quiverkey_doc(self):
380-
return self.__init__.__doc__
381-
382377

383378
def _parse_args(*args, caller_name='function'):
384379
"""

lib/matplotlib/tests/test_axes.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5660,15 +5660,6 @@ def test_none_kwargs():
56605660
assert ln.get_linestyle() == '-'
56615661

56625662

5663-
def test_ls_ds_conflict():
5664-
# Passing the drawstyle with the linestyle is deprecated since 3.1.
5665-
# We still need to test this until it's removed from the code.
5666-
# But we don't want to see the deprecation warning in the test.
5667-
with matplotlib._api.suppress_matplotlib_deprecation_warning(), \
5668-
pytest.raises(ValueError):
5669-
plt.plot(range(32), linestyle='steps-pre:', drawstyle='steps-post')
5670-
5671-
56725663
def test_bar_uint8():
56735664
xs = [0, 1, 2, 3]
56745665
b = plt.bar(np.array(xs, dtype=np.uint8), [2, 3, 4, 5], align="edge")

lib/matplotlib/text.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,8 +1596,7 @@ def __init__(self, text, xy,
15961596
Parameters
15971597
----------
15981598
text : str
1599-
The text of the annotation. *s* is a deprecated synonym for this
1600-
parameter.
1599+
The text of the annotation.
16011600
16021601
xy : (float, float)
16031602
The point *(x, y)* to annotate. The coordinate system is determined

0 commit comments

Comments
 (0)
0