-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Be more correct when validating bbox rc params #4647
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
Conversation
@@ -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': |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Just pushed up comments and docstring tweaks. By the way, validation of |
@WeatherGod Thanks, can you open an issue on the interpolation issue? |
Be more correct when validating bbox rc params
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.