Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve code generated by boilerplate.py#10309

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dstansby merged 1 commit intomatplotlib:masterfromtimhoffm:improve-boilerplate
Feb 2, 2018

Conversation

timhoffm
Copy link
Member

PR Summary

This PR improves the code generated byboilerplate.py. In particular

  • make the boilerplate-no-change-comment fit on one line (just aesthetics).
  • make the docstrings of the colormap-functions PEP8 conform.
  • change the code of the colormap functions to just callingset_colormap (the code from there was just duplicated). Below is an example of a changed colormap function as it's not easily readable in the diff.

Before:

def autumn():    '''    set the default colormap to autumn and apply to current image if any.    See help(colormaps) for more information    '''    rc('image', cmap='autumn')    im = gci()    if im is not None:        im.set_cmap(cm.autumn)

After:

def autumn():    """    Set the colormap to "autumn".    This changes the default colormap as well as the colormap of the current    image if there is one. See ``help(colormaps)`` for more information.    """    set_cmap("autumn")

@timhoffmtimhoffm changed the titleimprove code generated by boilerplate.pyImprove code generated by boilerplate.pyJan 24, 2018
@timhoffmtimhoffm added this to thev2.2 milestoneJan 24, 2018
@anntzer
Copy link
Contributor

See also#9173...

Copy link
Member

@jklymakjklymak left a comment

Choose a reason for hiding this comment

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

Needs to pass, but I think it will...

Yes@anntzer PR will gobble this one up, but this one doesn't hurt....

@dstansby
Copy link
Member

I think this might need a rebase to make the travis job pass

@timhoffm
Copy link
MemberAuthor

Do I have to do something about the codecov before merge? AFAICS none of the colormaps functions is tested and therefore all changed code is untested as well. But I don't think it's necessary to test these functions as they are trivial.

@jklymak
Copy link
Member

I think it not passing codecov is fine. I think if you want to be fancy you could tell codecov to not look at these files. Not merging, because this is a big enough change someone else should also look at it.

@dstansbydstansby merged commitdb1cde0 intomatplotlib:masterFeb 2, 2018
@QuLogicQuLogic modified the milestones:needs sorting,v2.2.0Feb 12, 2018
@timhoffmtimhoffm deleted the improve-boilerplate branchDecember 17, 2018 20:39
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v2.2.0
Development

Successfully merging this pull request may close these issues.

5 participants
@timhoffm@anntzer@dstansby@jklymak@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp