Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9a62069

Browse filesBrowse files
ananya314rsp2210
authored andcommitted
Removed deprecated code from animation.py
Remove the 3.7 deprecated code from axis.py (matplotlib#26871) Fixed deprecated APIs in lines.py Implemented the suggested changes Addressed .rst file issues Fixed deprecated APIs in lines.py Implemented the suggested changes Removed White Space
1 parent 51b27a1 commit 9a62069
Copy full SHA for 9a62069

File tree

Expand file treeCollapse file tree

8 files changed

+19
-28
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+19
-28
lines changed
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
``Line2D``
2+
~~~~~~~~~~
3+
4+
When creating a Line2D or using `.Line2D.set_xdata` and `.Line2D.set_ydata`,
5+
passing x/y data as non sequence is deprecated.
6+
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``matplotlib.axis.Axis.set_ticklabels``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... a param was renamed to labels from ticklabels.
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
``repeat``
2+
~~~~~~~~~~
3+
... of `.TimedAnimation` is removed without replacements.
4+
``save_count``
5+
~~~~~~~~~~~~~~
6+
... of `.FuncAnimation` is removed without replacements.

‎lib/matplotlib/animation.py

Copy file name to clipboardExpand all lines: lib/matplotlib/animation.py
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,8 +1446,6 @@ def _step(self, *args):
14461446
self.event_source.interval = self._interval
14471447
return True
14481448

1449-
repeat = _api.deprecate_privatize_attribute("3.7")
1450-
14511449

14521450
class ArtistAnimation(TimedAnimation):
14531451
"""
@@ -1788,8 +1786,6 @@ def _draw_frame(self, framedata):
17881786
for a in self._drawn_artists:
17891787
a.set_animated(self._blit)
17901788

1791-
save_count = _api.deprecate_privatize_attribute("3.7")
1792-
17931789

17941790
def _validate_grabframe_kwargs(savefig_kwargs):
17951791
if mpl.rcParams['savefig.bbox'] == 'tight':

‎lib/matplotlib/animation.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/animation.pyi
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ class Animation:
188188
def resume(self) -> None: ...
189189

190190
class TimedAnimation(Animation):
191-
repeat: bool
192191
def __init__(
193192
self,
194193
fig: Figure,
@@ -204,7 +203,6 @@ class ArtistAnimation(TimedAnimation):
204203
def __init__(self, fig: Figure, artists: Sequence[Collection[Artist]], *args, **kwargs) -> None: ...
205204

206205
class FuncAnimation(TimedAnimation):
207-
save_count: int
208206
def __init__(
209207
self,
210208
fig: Figure,

‎lib/matplotlib/axis.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axis.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,6 @@ def set_pickradius(self, pickradius):
19411941
def _format_with_dict(tickd, x, pos):
19421942
return tickd.get(x, "")
19431943

1944-
@_api.rename_parameter("3.7", "ticklabels", "labels")
19451944
def set_ticklabels(self, labels, *, minor=False, fontdict=None, **kwargs):
19461945
r"""
19471946
[*Discouraged*] Set this Axis' tick labels with list of string labels.

‎lib/matplotlib/lines.py

Copy file name to clipboardExpand all lines: lib/matplotlib/lines.py
+2-16Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,14 +1276,7 @@ def set_xdata(self, x):
12761276
x : 1D array
12771277
"""
12781278
if not np.iterable(x):
1279-
# When deprecation cycle is completed
1280-
# raise RuntimeError('x must be a sequence')
1281-
_api.warn_deprecated(
1282-
since="3.7",
1283-
message="Setting data with a non sequence type "
1284-
"is deprecated since %(since)s and will be "
1285-
"remove %(removal)s")
1286-
x = [x, ]
1279+
raise RuntimeError('x must be a sequence')
12871280
self._xorig = copy.copy(x)
12881281
self._invalidx = True
12891282
self.stale = True
@@ -1297,14 +1290,7 @@ def set_ydata(self, y):
12971290
y : 1D array
12981291
"""
12991292
if not np.iterable(y):
1300-
# When deprecation cycle is completed
1301-
# raise RuntimeError('y must be a sequence')
1302-
_api.warn_deprecated(
1303-
since="3.7",
1304-
message="Setting data with a non sequence type "
1305-
"is deprecated since %(since)s and will be "
1306-
"remove %(removal)s")
1307-
y = [y, ]
1293+
raise RuntimeError('y must be a sequence')
13081294
self._yorig = copy.copy(y)
13091295
self._invalidy = True
13101296
self.stale = True

‎lib/matplotlib/tests/test_lines.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_lines.py
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,9 @@ def test_invalid_line_data():
9292
mlines.Line2D([], 1)
9393

9494
line = mlines.Line2D([], [])
95-
# when deprecation cycle is completed
96-
# with pytest.raises(RuntimeError, match='x must be'):
97-
with pytest.warns(mpl.MatplotlibDeprecationWarning):
95+
with pytest.raises(RuntimeError, match='x must be'):
9896
line.set_xdata(0)
99-
# with pytest.raises(RuntimeError, match='y must be'):
100-
with pytest.warns(mpl.MatplotlibDeprecationWarning):
97+
with pytest.raises(RuntimeError, match='y must be'):
10198
line.set_ydata(0)
10299

103100

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.