Skip to content

DOC - SpanSelector widget documentation - #7047

Merged
tacaswell merged 2 commits into
matplotlib:masterfrom
LindyBalboa:issue_7009
Sep 9, 2016
Merged

tacaswell merged 2 commits into
matplotlib:masterfrom
LindyBalboa:issue_7009

Conversation

@LindyBalboa

@LindyBalboa LindyBalboa commented Sep 6, 2016 •

Copy link
Copy Markdown
Contributor

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
Comment thread lib/matplotlib/widgets.py Outdated
Dictionary of :class:`matplotlib.patches.Patch` properties

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
Copy Markdown
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

NelleV commented Sep 6, 2016

Copy link
Copy Markdown
Member

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

QuLogic commented Sep 6, 2016

Copy link
Copy Markdown
Member

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.

Comment thread lib/matplotlib/widgets.py Outdated
self.artists = [self.rect]

def ignore(self, event):
def _ignore(self, event):

@QuLogic QuLogic Sep 6, 2016 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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

LindyBalboa commented Sep 7, 2016 •

Copy link
Copy Markdown
Contributor Author

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

NelleV commented Sep 7, 2016

Copy link
Copy Markdown
Member

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
Copy Markdown
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

Kojoley commented Sep 8, 2016

Copy link
Copy Markdown
Member

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

NelleV commented Sep 8, 2016

Copy link
Copy Markdown
Member

The failure on travis is unrelated. LGTM 👍

@jenshnielsen

Copy link
Copy Markdown
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
Copy Markdown
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