-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Expire deprecations in widgets and keyword only arguments for Selectors #24254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Most arguments to widgets have been made keyword-only | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Passing all but the very few first arguments positionally in the constructors | ||
of Widgets is deprecated. Most arguments will become keyword-only in a future | ||
version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Removal of deprecations in the Selector widget API | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
RectangleSelector and EllipseSelector | ||
..................................... | ||
|
||
The *drawtype* keyword argument to `~matplotlib.widgets.RectangleSelector` is | ||
removed. From now on, the only behaviour will be ``drawtype='box'``. | ||
|
||
Support for ``drawtype=line`` is removed altogether. As a | ||
result, the *lineprops* keyword argument to | ||
`~matplotlib.widgets.RectangleSelector` is also removed. | ||
|
||
To retain the behaviour of ``drawtype='none'``, use ``rectprops={'visible': | ||
False}`` to make the drawn `~matplotlib.patches.Rectangle` invisible. | ||
|
||
Cleaned up attributes and arguments are: | ||
|
||
- The ``active_handle`` attribute has been privatized and removed. | ||
- The ``drawtype`` attribute has been privatized and removed. | ||
- The ``eventpress`` attribute has been privatized and removed. | ||
- The ``eventrelease`` attribute has been privatized and removed. | ||
- The ``interactive`` attribute has been privatized and removed. | ||
- The *marker_props* argument is removed, use *handle_props* instead. | ||
- The *maxdist* argument is removed, use *grab_range* instead. | ||
- The *rectprops* argument is removed, use *props* instead. | ||
- The ``rectprops`` attribute has been privatized and removed. | ||
- The ``state`` attribute has been privatized and removed. | ||
- The ``to_draw`` attribute has been privatized and removed. | ||
|
||
PolygonSelector | ||
............... | ||
|
||
- The *line* attribute is removed. If you want to change the selector artist | ||
properties, use the ``set_props`` or ``set_handle_props`` methods. | ||
- The *lineprops* argument is removed, use *props* instead. | ||
- The *markerprops* argument is removed, use *handle_props* instead. | ||
- The *maxdist* argument and attribute is removed, use *grab_range* instead. | ||
- The *vertex_select_radius* argument and attribute is removed, use | ||
*grab_range* instead. | ||
|
||
SpanSelector | ||
............ | ||
|
||
- The ``active_handle`` attribute has been privatized and removed. | ||
- The ``eventpress`` attribute has been privatized and removed. | ||
- The ``eventrelease`` attribute has been privatized and removed. | ||
- The ``pressv`` attribute has been privatized and removed. | ||
- The ``prev`` attribute has been privatized and removed. | ||
- The ``rect`` attribute has been privatized and removed. | ||
- The *rectprops* parameter has been renamed to *props*. | ||
- The ``rectprops`` attribute has been privatized and removed. | ||
- The *span_stays* parameter has been renamed to *interactive*. | ||
- The ``span_stays`` attribute has been privatized and removed. | ||
- The ``state`` attribute has been privatized and removed. | ||
|
||
LassoSelector | ||
............. | ||
|
||
- The *lineprops* argument is removed, use *props* instead. | ||
- The ``onpress`` and ``onrelease`` methods are removed. They are straight | ||
aliases for ``press`` and ``release``. | ||
- The ``matplotlib.widgets.TextBox.DIST_FROM_LEFT`` attribute has been | ||
removed. It was marked as private in 3.5. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removal of
TextBox.DIST_FROM_LEFT
is missing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW this is all just copied and pasted from the 3.5 release notes and deprecated replaced with removed (more or less).
But I will of course edit accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this was deprecated in bd9ee5e but we did not get a API change note with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I update this to be deprecated in 3.7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been warning, but was not documented. The conservative thing to do is put it back, document it removed in 3.7 and drop it in 3.8, but I'm inclined to be a bit YOLO here and just document that it is removed in 3.7 as this is a very niche feature...