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

Be more correct when validating bbox rc params #4647

Merged
merged 3 commits into from Jul 12, 2015

Conversation

WeatherGod
Copy link
Member

right now, validate_bbox would let non strings validate as correct when that isn't the case. Also use the 'standard' name instead of None for the parameter.

@WeatherGod WeatherGod added this to the next point release milestone Jul 12, 2015
@@ -110,7 +110,7 @@ def validate_float(s):

def validate_float_or_None(s):
"""convert s to float or raise"""
if s is None:
if s is None or s == 'None':
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain why this is needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the object from an rcfile can't be a None object, only the string. There is only one situation that I can find where it is valid to say None in the rc file and mean the object and one situation where it is valid to say None/none in the rc file and mean the string or possibly the object (the default interpolation mode). This takes care of the former situation. We probably should double-check how we are handling the latter.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, I would suggest adding a comment explaining that

@WeatherGod
Copy link
Member Author

Just pushed up comments and docstring tweaks. By the way, validation of image.interpolation is just against six.text_type as opposed to a string list of possible values. And no support for specifying None interpolation as opposed to 'none' interpolation. Don't know if we want to go down that rabbit hole here.

@jenshnielsen
Copy link
Member

@WeatherGod Thanks, can you open an issue on the interpolation issue?

jenshnielsen added a commit that referenced this pull request Jul 12, 2015
Be more correct when validating bbox rc params
@jenshnielsen jenshnielsen merged commit e405a68 into matplotlib:master Jul 12, 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.

None yet

3 participants