Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 648b4a8

Browse files
committed
Expire deprecations in widgets and keyword only arguments for Selectors
1 parent d8bb1a5 commit 648b4a8

File tree

4 files changed

+111
-155
lines changed

4 files changed

+111
-155
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Most arguments to widgets have been made positional
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Passing all but the very few first arguments positionally in the constructors
5+
of Widgets is deprecated. Most arguments will become keyword-only in a future
6+
version.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Removal of deprecations in the Selector widget API
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
RectangleSelector and EllipseSelector
5+
.....................................
6+
7+
The *drawtype* keyword argument to `~matplotlib.widgets.RectangleSelector` is
8+
removed. From now on, the only behaviour will be ``drawtype='box'``.
9+
10+
Support for ``drawtype=line`` is removed altogether. As a
11+
result, the *lineprops* keyword argument to
12+
`~matplotlib.widgets.RectangleSelector` is also removed.
13+
14+
To retain the behaviour of ``drawtype='none'``, use ``rectprops={'visible':
15+
False}`` to make the drawn `~matplotlib.patches.Rectangle` invisible.
16+
17+
Cleaned up attributes and arguments are:
18+
19+
- The ``active_handle`` attribute has been privatized and removed.
20+
- The ``drawtype`` attribute has been privatized and removed.
21+
- The ``eventpress`` attribute has been privatized and removed.
22+
- The ``eventrelease`` attribute has been privatized and removed.
23+
- The ``interactive`` attribute has been privatized and removed.
24+
- The *marker_props* argument is removed, use *handle_props* instead.
25+
- The *maxdist* argument is removed, use *grab_range* instead.
26+
- The *rectprops* argument is removed, use *props* instead.
27+
- The ``rectprops`` attribute has been privatized and removed.
28+
- The ``state`` attribute has been privatized and removed.
29+
- The ``to_draw`` attribute has been privatized and removed.
30+
31+
PolygonSelector
32+
...............
33+
34+
- The *line* attribute is removed. If you want to change the selector artist
35+
properties, use the ``set_props`` or ``set_handle_props`` methods.
36+
- The *lineprops* argument is removed, use *props* instead.
37+
- The *markerprops* argument is removed, use *handle_props* instead.
38+
- The *maxdist* argument and attribute is removed, use *grab_range* instead.
39+
- The *vertex_select_radius* argument and attribute is removed, use
40+
*grab_range* instead.
41+
42+
SpanSelector
43+
............
44+
45+
- The ``active_handle`` attribute has been privatized and removed.
46+
- The ``eventpress`` attribute has been privatized and removed.
47+
- The ``eventrelease`` attribute has been privatized and removed.
48+
- The *maxdist* argument and attribute is removed, use *grab_range* instead.
49+
- The ``pressv`` attribute has been privatized and removed.
50+
- The ``prev`` attribute has been privatized and removed.
51+
- The ``rect`` attribute has been privatized and removed.
52+
- The *rectprops* argument is removed, use *props* instead.
53+
- The ``rectprops`` attribute has been privatized and removed.
54+
- The *span_stays* argument is removed, use the *interactive* argument
55+
instead.
56+
- The ``span_stays`` attribute has been privatized and removed.
57+
- The ``state`` attribute has been privatized and removed.
58+
59+
LassoSelector
60+
.............
61+
62+
- The *lineprops* argument is removed, use *props* instead.
63+
- The ``onpress`` and ``onrelease`` methods are removed. They are straight
64+
aliases for ``press`` and ``release``.

lib/matplotlib/tests/test_widgets.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ def ax():
2424

2525
@pytest.mark.parametrize('kwargs, warning_msg', [
2626
(dict(), None),
27-
(dict(drawtype='line', useblit=False),
28-
"Support for drawtype='line' is deprecated"),
2927
(dict(useblit=True, button=1), None),
30-
(dict(drawtype='none', minspanx=10, minspany=10),
31-
"Support for drawtype='none' is deprecated"),
3228
(dict(minspanx=10, minspany=10, spancoords='pixels'), None),
3329
(dict(props=dict(fill=True)), None),
3430
])

0 commit comments

Comments
 (0)