-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
adding default toggled state for toggle tools #6407
Conversation
---------- | ||
*args | ||
Variable length argument to be used by the Tool | ||
**kwargs |
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.
What is the standard to document optional kwargs? like toggled
in this particular case?
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.
at least wrap it it double back ticks so that rst does not choke on opened, but not closed emphasis
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. |
b1d288b
to
2946322
Compare
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. |
2946322
to
b440068
Compare
@QuLogic pep8 erros corrected |
ready to merge? |
@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. |
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_xxx
eventWith the changes in this PR, the initial state can be changed by class attribute during Tool definition
default_toggle = True
or at the moment of adding the tool to the Toolmanagertoolmanager.add_tool('Name', ToolCls, toggle=True)