Skip to content
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

Merged
merged 1 commit into from
Aug 8, 2016

Conversation

fariza
Copy link
Member

@fariza fariza commented May 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_xxx event

With 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 Toolmanager toolmanager.add_tool('Name', ToolCls, toggle=True)

----------
*args
Variable length argument to be used by the Tool
**kwargs
Copy link
Member Author

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?

Copy link
Member

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

@tacaswell tacaswell added this to the 2.1 (next point release) milestone May 12, 2016
@tacaswell
Copy link
Member

The docs are passing which makes me think these are not actually in the docs?

@fariza
Copy link
Member Author

fariza commented May 12, 2016

It is building the docs, I got that from a numpydoc example somewhere and it didn't have quotes around it

@tacaswell
Copy link
Member

Interesting, I spent some time fighting with things like that breaking the doc build on some day-job projects.....

@fariza
Copy link
Member Author

fariza commented May 12, 2016

Just in case I added the double back tick

@fariza
Copy link
Member Author

fariza commented May 12, 2016

I don't think the fail is related to these changes

@fariza
Copy link
Member Author

fariza commented May 12, 2016

@OceanWolf any thoughts on this?

@fariza
Copy link
Member Author

fariza commented Jun 9, 2016

@OceanWolf this one is the other that needs a little bit of your attention.
But it doesn't affect MEP27,

@OceanWolf
Copy link
Member

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.

@fariza
Copy link
Member Author

fariza commented Jun 22, 2016

I rebased to eliminate conflicts and upgraded the example to use the initial toggled state
I transformed the tool from Hide to Show

@QuLogic
Copy link
Member

QuLogic commented Jun 22, 2016

You have some PEP8 errors; AppVeyor failure appears to be unrelated.

@fariza
Copy link
Member Author

fariza commented Jun 22, 2016

@QuLogic pep8 erros corrected

@fariza
Copy link
Member Author

fariza commented Aug 2, 2016

ready to merge?

@fariza fariza merged commit 888bf17 into matplotlib:master Aug 8, 2016
@fariza fariza deleted the toggletool-initial-state branch August 8, 2016 15:48
@WeatherGod
Copy link
Member

@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?

@fariza
Copy link
Member Author

fariza commented Aug 16, 2016

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
test this kind of things.
What I was planning is to wait for Mep27 to land and stabilize. Then add a
complete "virtual backend" that will allow to test all the tools and
managers. In this case the coverage goes down just because of extra lines
of code but it is not an actual reduction.

Federico

On Aug 16, 2016 5:12 PM, "Benjamin Root" notifications@github.com wrote:

@fariza https://github.com/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?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#6407 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABa86WZXYz-HkxVxzc6jcj-bLiZtxzhEks5qgifAgaJpZM4Icle9
.

@OceanWolf
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants