-
Notifications
You must be signed in to change notification settings - Fork 299
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 pythonic aliases for comparison predicates. #553
base: master
Are you sure you want to change the base?
Conversation
Can you help me understand the rationale for why this addition is needed/beneficial? |
While keywords like |
I would also like to add that this is the notation already used in the some of the function's descriptions. @staticmethod
def above(y):
"""Greater than y.""" |
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 can agree to seeing that this might be beneficial and it's great that it's just adding a simple alias, so there's no code maintainability issues. I just want to ensure that code testing coverage isn't hit as a result of this new code, so can we please add some testing code around the new methods?
Once we have the testing code, I can merge this in, it's in great condition. Thanks!
I added methods replicating the existing ones. I've never worked with pytest, however, so please do let me know if anything needs to be amended. |
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.
Hey, this is very close to being mergable - thank you! You should be able to see updated coverage when you push new commits now.
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. | |||
|
|||
This project adheres to [Semantic Versioning](http://semver.org/). | |||
|
|||
### v0.17.7 | |||
* Add pythonic aliases for comparison predicates. | |||
* Add alias tests to test_predicates.py |
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 :)
|
||
@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 comment
The 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!
[ ] Added changes to CHANGELOG.md
[ ] Bumped version number (delete if unneeded)
Changes proposed:
Add pythonic aliases for comparison predicates.
Ex: added
are.greater_than
as an alias ofare.above