-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add min arg to UserDefined #114
Conversation
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 for the quick response :). As I mention in the code, with min
we're overriding the built-in function so we should ideally use a different keyword here.
mapclassify/classifiers.py
Outdated
lowest = mc.y.min() | ||
if hasattr(mc, 'min'): | ||
if mc.min: |
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.
if mc.min: | |
if mc.min is not None: |
Otherwise it wouldn't work for min=0
.
mapclassify/classifiers.py
Outdated
@@ -2256,9 +2266,10 @@ class UserDefined(MapClassifier): | |||
|
|||
""" | |||
|
|||
def __init__(self, y, bins): | |||
def __init__(self, y, bins, min=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.
I'd rather use another keyword because now we're overriding built-in min()
. Something like legend_min
or lowest
?
mapclassify/classifiers.py
Outdated
lowest = mc.y.min() | ||
if hasattr(mc, 'lowest'): | ||
if mc.lowest: |
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.
if mc.lowest: | |
if mc.lowest is not None: |
Just to ensure we don't forget about this. We need to be explicit to ensure it works for 0.
This addresses #113