File tree 3 files changed +8
-21
lines changed
doc/api/next_api_changes/behavior
3 files changed +8
-21
lines changed Original file line number Diff line number Diff line change
1
+ ``set_xdata `` and ``set_ydata `` requires an iterable.
2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
+
4
+ These APIs require argument which is iterable, use of non sequence type is not supported.
Original file line number Diff line number Diff line change @@ -1276,14 +1276,7 @@ def set_xdata(self, x):
1276
1276
x : 1D array
1277
1277
"""
1278
1278
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' )
1287
1280
self ._xorig = copy .copy (x )
1288
1281
self ._invalidx = True
1289
1282
self .stale = True
@@ -1297,14 +1290,7 @@ def set_ydata(self, y):
1297
1290
y : 1D array
1298
1291
"""
1299
1292
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' )
1308
1294
self ._yorig = copy .copy (y )
1309
1295
self ._invalidy = True
1310
1296
self .stale = True
Original file line number Diff line number Diff line change @@ -92,12 +92,9 @@ def test_invalid_line_data():
92
92
mlines .Line2D ([], 1 )
93
93
94
94
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' ):
98
96
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' ):
101
98
line .set_ydata (0 )
102
99
103
100
You can’t perform that action at this time.
0 commit comments