-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added get_status() function to the CheckButtons widget #6018
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
Added get_status() function to the CheckButtons widget #6018
Conversation
""" | ||
returns a tuple of the status (True/False) of all of the check buttons | ||
""" | ||
return [l1.get_visible() for (l1,l2) in self.lines] |
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.
- space after comma.
@QuLogic: sure! Comma added! |
Needs unit test, and an update to whats_new.rst. On Wed, Feb 17, 2016 at 7:44 PM, Danhickstein [email protected]
|
Please create a new file in the whats_new folder, not editing the main rst file (it helps keep merge confilcts down). The readme in that folder has a template. |
@tacaswell @WeatherGod, sounds good! I'll get to work on that. |
Added a basic unit test for the CheckButtons class to lib/matplotlib/tests/test_widgets.py Also, added a description of the new `get_status` function to `doc/users/whats_new/CheckButtons_widget_get_status.rst`
Okay, I added a file to I couldn't figure out how to use the |
Hmmm, I don't really understand why the TravisCI tests are failing. It seems to have to do with some colorbar plot comparisons. I don't think that I should have caused any problems with these. Should I worry about this? |
No, there was a problem commit that got merged into master last week that caused problems. I closed/reopened your PR to force a re-run of the CI's. |
Note, we haven't figured out how to force Appveyor to redo their runs, so ignore that for now. |
Thanks! |
I cleaned up the code to conform to pep8, and now it passes that test. The Travis Python 2.7 test is still failing. It's one of the font tests, so it seems unrelated to these changes. |
Oh, it looks like Travis and Appveyor are building just fine now. Anything else that you would like me to add to this PR? |
Added get_status() function to the CheckButtons widget
Looks fine to me. Could probably spruce up the unit test a bit, but we can leave that as a future task. |
This allows the user to query the status of a CheckButtons instance using
check.get_status()
as discussed in issue #5930 (comment)Here is an adaptation of the CheckButtons example to show this functionality:
I also fixed a typo in the CheckButtons docstring that referred to them as "radio button".