Skip to content

Remove the 'hold' kwarg from codebase #10485

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 4 commits into from
Mar 29, 2018
Merged

Conversation

dstansby
Copy link
Member

Another step in to the bright new post python 2.7 world, this time removing the hold kwarg. As far as I can see I've got rid of all the _hold instances in the code base. Lets see what happens with the tests...

@dstansby dstansby added this to the v3.0 milestone Feb 15, 2018

return ret

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@_autogen_docstring(Axes.angle_spectrum)
def angle_spectrum(x, Fs=None, Fc=None, window=None, pad_to=None, sides=None,
hold=None, data=None, **kwargs):
**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.

Note to future me: the data kwarg shouldn't have gone here, this needs fixing. (or if anyone fancies force pushing a fix to my branch)

@tacaswell
Copy link
Member

The +/- on this PR is amazing!

@QuLogic
Copy link
Member

QuLogic commented Feb 17, 2018

I think this is somewhat covered by #9173, though it's a bit old and has some conflicts.

@efiring
Copy link
Member

efiring commented Feb 17, 2018

There is overlap with #9173, but I think it would be reasonable to merge this once the tests pass, and then revisit the approach in #9173.
It looks like the test problem is a single missed _hold in tripcolor.

@anntzer
Copy link
Contributor

anntzer commented Feb 17, 2018

I'll need to revisit #9173 anyways, so no worries.

@dstansby dstansby changed the title [WIP] Remove the 'hold' kwarg from codebase Remove the 'hold' kwarg from codebase Feb 19, 2018
Copy link
Member

@efiring efiring left a comment

Choose a reason for hiding this comment

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

Tests pass now, so I think it is ready to go.

@tacaswell
Copy link
Member

Just needs API changes docs!

%(ret)s = %(ax)s.%(func)s(%(call)s)
finally:
%(ax)s._hold = %(washold)s
%(ret)s = %(ax)s.%(func)s(%(call)s)
Copy link
Contributor

Choose a reason for hiding this comment

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

Even simpler would be to just do return gca().func(...), which avoids the need for temporary variables and thus allows you to get rid of the "gensym-like facility" mentioned lower in this script.

Copy link
Member

Choose a reason for hiding this comment

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

👍 the only reason we needed the local reference to the return value was so we could reset the hold.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

This all seems good to me. Needs a rebase; Not sure if you wanted to address the few comments below.

@anntzer
Copy link
Contributor

anntzer commented Mar 29, 2018

Still a few fixes applicable but let's get this in first.

@anntzer anntzer merged commit ffe6021 into matplotlib:master Mar 29, 2018
@dstansby dstansby deleted the remove-hold branch March 30, 2018 07:29
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