-
Notifications
You must be signed in to change notification settings - Fork 310
Add pythonic aliases for comparison predicates. #553
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
base: master
Are you sure you want to change the base?
Changes from all commits
1b45920
2bed9eb
be1427a
064f162
2c833a0
4608d2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,6 +211,49 @@ def not_containing(substring): | |
def not_contained_in(superstring): | ||
"""A string that is not contained within the superstring""" | ||
return -(are.contained_in(superstring)) | ||
|
||
############### | ||
# Aliases # | ||
############### | ||
|
||
@staticmethod | ||
def less_than(y): | ||
"""Less than y.""" | ||
return are.below(y) | ||
|
||
@staticmethod | ||
def greater_than(y): | ||
"""Greater than y.""" | ||
return are.above(y) | ||
|
||
@staticmethod | ||
def greater_than_or_equal_to(y): | ||
return are.above_or_equal_to(y) | ||
|
||
@staticmethod | ||
def less_than_or_equal_to(y): | ||
return are.below_or_equal_to(y) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on: https://coveralls.io/builds/55559799/source?filename=datascience%2Fpredicates.py We're missing test coverage on this method and a few others. The tests you've created are fantastic so far, if you could please add a few more for the missing test methods - this should be mergeable! |
||
|
||
@staticmethod | ||
def not_greater_than_or_equal_to(y): | ||
"""Is neither above y nor equal to y""" | ||
return are.not_above_or_equal_to(y) | ||
|
||
@staticmethod | ||
def not_less_than_or_equal_to(y): | ||
"""Is neither below y nor equal to y""" | ||
return are.not_below_or_equal_to(y) | ||
|
||
@staticmethod | ||
def not_greater_than(y): | ||
"""Is not above y""" | ||
return are.not_above(y) | ||
|
||
@staticmethod | ||
def not_less_than(y): | ||
"""Is not below y""" | ||
return are.not_below(y) | ||
|
||
############### | ||
# Combination # | ||
############### | ||
|
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.
We don't need this line. Just the first one is fine :)