Fixed deprecated APIs in lines.py by rsp2210 · Pull Request #26902 · matplotlib/matplotlib · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/api/next_api_changes/behavior/26902-RP.rst
18 changes: 2 additions & 16 deletions lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,14 +1276,7 @@ def set_xdata(self, x):
x : 1D array
"""
if not np.iterable(x):
# When deprecation cycle is completed
# raise RuntimeError('x must be a sequence')
_api.warn_deprecated(
since="3.7",
message="Setting data with a non sequence type "
"is deprecated since %(since)s and will be "
"remove %(removal)s")
x = [x, ]
raise RuntimeError('x must be a sequence')
self._xorig = copy.copy(x)
self._invalidx = True
self.stale = True
Expand All @@ -1297,14 +1290,7 @@ def set_ydata(self, y):
y : 1D array
"""
if not np.iterable(y):
# When deprecation cycle is completed
# raise RuntimeError('y must be a sequence')
_api.warn_deprecated(
since="3.7",
message="Setting data with a non sequence type "
"is deprecated since %(since)s and will be "
"remove %(removal)s")
y = [y, ]
raise RuntimeError('y must be a sequence')
self._yorig = copy.copy(y)
self._invalidy = True
self.stale = True
Expand Down
7 changes: 2 additions & 5 deletions lib/matplotlib/tests/test_lines.py