Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
adding default toggled state for toggle tools #6407
Conversation
mdboom
added the
needs_review
label
May 11, 2016
fariza
and 1 other
commented on an outdated diff
May 11, 2016
| @@ -138,6 +138,14 @@ class ToolToggleBase(ToolBase): | ||
| Toggleable tool | ||
| Every time it is triggered, it switches between enable and disable | ||
| + | ||
| + Parameters | ||
| + ---------- | ||
| + *args | ||
| + Variable length argument to be used by the Tool | ||
| + **kwargs |
fariza
Member
|
tacaswell
added this to the
2.1 (next point release)
milestone
May 12, 2016
|
The docs are passing which makes me think these are not actually in the docs? |
|
It is building the docs, I got that from a numpydoc example somewhere and it didn't have quotes around it |
|
Interesting, I spent some time fighting with things like that breaking the doc build on some day-job projects..... |
|
Just in case I added the double back tick |
|
I don't think the fail is related to these changes |
|
@OceanWolf any thoughts on this? |
|
@OceanWolf this one is the other that needs a little bit of your attention. |
|
Just gave it a quick look and it looks good to me. Will give it another look later. When I first started reading I thought you might go down the object overriding class attribute approach, as far as I see both methods work fine. |
|
I rebased to eliminate conflicts and upgraded the example to use the initial toggled state |
|
You have some PEP8 errors; AppVeyor failure appears to be unrelated. |
|
@QuLogic pep8 erros corrected |
|
ready to merge? |
fariza
merged commit 888bf17
into matplotlib:master
Aug 8, 2016
mdboom
removed the
needs_review
label
Aug 8, 2016
fariza
deleted the
fariza:toggletool-initial-state branch
Aug 8, 2016
|
@fariza, I just noticed that this PR was self-merged. I don't want to make a huge deal about it, as these changes are non-controversial and there was a lack of responses to the PR. The matplotlib organization does not enforce a ban on self-merges, but it is highly discouraged. We don't enforce such a ban because there are emergency situations where it is the correct thing to do (getting TravisCI happy again because pyparsing put out a bad release is an example). What I would suggest you do next time you get a lack of responses to your PR is to ping the PR. If you still don't get responses, then raise the issue on the gitter chat room or on the mailing list. The lack of responses could simply be due to vacation schedules or other things going on. As for this PR, if I had actually spent time reviewing it at the time (sorry for not doing so), I would have asked for some tests, if it was possible. The coverage went down because of this PR, which is less than ideal. If tests are possible, then could you please create a PR to include them, please? |
|
Sorry for the self merge. I understand the policy and be sure it won't happen again. Regarding the tests, at this moment we don't have the infrastructure to Federico On Aug 16, 2016 5:12 PM, "Benjamin Root" notifications@github.com wrote:
|
|
@WeatherGod Ahh, so the coveralls relates to how much of the codebase we have covered by unit-tests? I kind of understood that that policy existed, but do we have a guide somewhere outlining these kinds of things for the less obvious rules/guidelines? As for fariza's point, yes, unit tests for backends becomes very difficult due to their graphical nature. In MEP27 I added the template classes, so maybe we can do our testing around that? I had hoped that pgi would solve our testing woes with gtk3, but alas it works well enough for basic testing, but not good enough for production yet (very buggy). Maybe I can take another look at pgi, improve my gdb debugging skills with python to learn where/how it segfaults, and get that up and running ASAP. |
fariza commentedMay 11, 2016
So far toggle tools start their life in the untoggled state, most of the time this is what we want but sometimes it is desirable to initialize a ToogleTool in a toggled state without firing the
tool_trigger_xxxeventWith the changes in this PR, the initial state can be changed by class attribute during Tool definition
default_toggle = Trueor at the moment of adding the tool to the Toolmanagertoolmanager.add_tool('Name', ToolCls, toggle=True)