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

Make axis.set_scale private #1917

Merged
merged 2 commits into from May 13, 2013
Merged

Conversation

tacaswell
Copy link
Member

Addresses fixes #1871 by making axis.set_scale private and adding a wrapper function with depreciation warning.

…d adding

a wrapper function with depreciation warning.
@pelson
Copy link
Member

pelson commented Apr 18, 2013

It seems odd to me that there should be a get_scale but no set_scale. I'm also mildly bothered by the fact that methods outside of Axis have to call the "private" methods. I don't have any suggestions here, just airing my thoughts...

Thanks for doing this @tacaswell .

@mdboom
Copy link
Member

mdboom commented Apr 18, 2013

Yeah -- marking as 1.3.x, but I want to think on this for a bit. I can't help thinking there might be a better way.

@tacaswell
Copy link
Member Author

Currently all of the calls to _set_scale are in methods of axes object methods, so it's not that bad.

My thoughts on this are colored by c++ style friend relationships. I don't see how an axis is useful outside of an axes or an axes is useful without an axis so the has-a and is-a relationships get fuzzy.

@@ -683,6 +685,17 @@ def get_scale(self):
return self._scale.name

def set_scale(self, value, **kwargs):
"""
Deprecatted 1.3.
Copy link
Member

Choose a reason for hiding this comment

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

Typo: deprecated

@tacaswell
Copy link
Member Author

Sorry about the spelling errors, did not realize the spell checker was not working.

I copied the import of mplDeprecation out of axes.py, should I make a PR to fix that too?

@NelleV
Copy link
Member

NelleV commented Apr 24, 2013

@tacaswell Yes please. That must be a left over when mplDeprecation was in the init.py file.

mdboom added a commit that referenced this pull request May 13, 2013
@mdboom mdboom merged commit fb2da34 into matplotlib:master May 13, 2013
@tacaswell tacaswell deleted the priv_axis.set_scale branch May 13, 2013 17:57
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jan 10, 2015
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jan 22, 2015
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.

set_scale and set_xscale
4 participants