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

RcParams class does not have proper "get" ability of deprecated keywords #4715

Closed
WeatherGod opened this issue Jul 16, 2015 · 0 comments
Closed

Comments

@WeatherGod
Copy link
Member

The RcParams class has a mechanism for deprecating keywords, and aliasing to an alternative keyword with a way to convert its data into the new data. This is useful for setting values. However, it uses the same alternates mechanism for getting the keyword's data, but no way to invert the conversion.

For example, I plan to deprecate 'axes.color_cycle' for 'axes.prop_cycle'. The color_cycle is a list of strings, while a prop_cycle is a cycler object. The deprecation mechanism makes it easy for me to add a lambda of the form lambda x: cycler('color', x), so that setting a list to 'axes.color_cycle' still works. But if anyone did rcParams['axes.color_cycle'], they would get back a cycler object instead of a list of colors.

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jul 16, 2015
Closes matplotlib#4715

Adds a third entry to the value tuple in _deprecated_map to allow
specifying an inverse map from the new value to the old.
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

No branches or pull requests

1 participant