Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC - SpanSelector widget documentation #7047

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 2 commits into from
Sep 9, 2016

Conversation

LindyBalboa
Copy link
Contributor

@LindyBalboa LindyBalboa commented Sep 6, 2016

Initial focus was to add a reference to AxesWidget.active in the documentation. I went ahead and made it numpy standard while I was in there.

Removed: I made the ignore method into _ignore so that it would not be build into the docs, as a user will have zero reason to call it.

Resolves #7009

@LindyBalboa LindyBalboa changed the title Issue 7009 - SpanSelector documentation DOC - SpanSelector widget documentation Sep 6, 2016

If *minspan* is not *None*, ignore events smaller than *minspan*
onmove_callback : function of form func(min, max), where min/max are floats, default is None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure this line is too long for the pep8 requirements (to be confirmed when travis finish running).

@NelleV
Copy link
Member

NelleV commented Sep 6, 2016

I am slightly confused on why the pep8 test pass here, while they don't for all of my students :(
Two lines are two long for our pep8 requirements:

widgets.py|1710 col 80| E501 line too long (96 > 79 characters)
widgets.py|1732 col 80| E501 line too long (89 > 79 characters)

Apart from this, and my additional comment, the patch looks good!

Thanks,
N

@QuLogic
Copy link
Member

QuLogic commented Sep 6, 2016

The changed file is listed in the known bad files list, so any PEP8 issues in it get ignored.

If your students wish to correct these issues, that would be much appreciated.

@@ -1794,7 +1799,7 @@ def new_axes(self, ax):
self.ax.add_patch(self.rect)
self.artists = [self.rect]

def ignore(self, event):
def _ignore(self, event):
Copy link
Member

@QuLogic QuLogic Sep 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure you should be changing the name here. Surely there are other callers that should be updated as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are totally right. I thought I changed where it is called as well. I will take another look.

@LindyBalboa
Copy link
Contributor Author

LindyBalboa commented Sep 7, 2016

I can't seem to do a linebreak with doctest line 1732 and make it work. And I feel making that line shorter would just muddle it and look poor. It turns out there is in fact an example for SpanSelector in the examples folder, but since it is interactive, telling it to plot to the docs doesn't make much sense.

Should I just make a link to the example, and if so, how would I make that link?

@NelleV
Copy link
Member

NelleV commented Sep 7, 2016

I think the following is fine::

>>> span = mwidgets.SpanSelector(ax, onselect, 'horizontal', 
                                 rectprops=rectprops)

@LindyBalboa LindyBalboa force-pushed the issue_7009 branch 2 times, most recently from 0ade4ba to 27aebe7 Compare September 8, 2016 11:23
Add reference to AxesWidget.active for disabling the selector.

Resolves matplotlib#7009
@LindyBalboa
Copy link
Contributor Author

So, Travis is giving this:

ValueError: Some exclude patterns were unnecessary as the files they pointed to either passed the PEP8 tests or do not point to a file:
E                 */matplotlib/widgets.py

Does that mean it can be removed from the list or am I missing something?

@Kojoley
Copy link
Member

Kojoley commented Sep 8, 2016

It seems you have fixed all pep8 problems in widgets.py, so yes, you should remove it from the pep8 exclusion list (this line in test_coding_standards.py).

@NelleV
Copy link
Member

NelleV commented Sep 8, 2016

The failure on travis is unrelated. LGTM 👍

@jenshnielsen
Copy link
Member

Failure is unrelated. Restarted the particular travis job to be sure

@tacaswell tacaswell merged commit ed9711d into matplotlib:master Sep 9, 2016
tacaswell added a commit that referenced this pull request Sep 9, 2016
DOC: SpanSelector widget documentation
@tacaswell
Copy link
Member

backported to v2.x as a2e56ad

@QuLogic QuLogic added this to the 2.0 (style change major release) milestone Sep 9, 2016
@LindyBalboa LindyBalboa deleted the issue_7009 branch September 9, 2016 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants