-
Notifications
You must be signed in to change notification settings - Fork 879
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
Implement IsWorkingHours and IsLunchTime #2130
Conversation
Should I include holiday checking for IsLunchTime? |
Codecov Report
@@ Coverage Diff @@
## main #2130 +/- ##
=======================================
Coverage 99.23% 99.24%
=======================================
Files 143 143
Lines 17196 17245 +49
=======================================
+ Hits 17065 17114 +49
Misses 131 131
Continue to review full report at Codecov.
|
@sbadithe I would make |
@gsheni Would it make sense to include a |
@sbadithe yes |
Merge branch 'workday-primitives' of https://github.com/alteryx/featuretools into workday-primitives
Merge branch 'workday-primitives' of https://github.com/alteryx/featuretools into workday-primitives
Examples: | ||
>>> from datetime import datetime | ||
>>> dates = [datetime(2022, 6, 21, 16, 3, 3), | ||
... datetime(2019,1,3,4,4,4), |
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.
fix formatting here to include white space
ilt = IsLunchTime(include_weekends=False, include_holidays=True) | ||
dates = pd.Series( | ||
[ | ||
datetime(2022, 6, 26, 12, 12, 12), |
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 include a comment that is something like Wed, Jun 26 2022 - (Holiday Name)
next to each of these examples everywhere
iwh = IsWorkingHours(15, 18) | ||
dates = pd.Series( | ||
[ | ||
datetime(2022, 6, 21, 16, 3, 3), # Weekday date |
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.
Include case outside working hours but on a weekday
Changes:
|
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.
Just a couple more minor things, but looking pretty good to me.
featuretools/primitives/standard/datetime_transform_primitives.py
Outdated
Show resolved
Hide resolved
featuretools/primitives/standard/datetime_transform_primitives.py
Outdated
Show resolved
Hide resolved
datetime(2022, 6, 21, 16, 3, 3), | ||
datetime(2019, 1, 3, 4, 4, 4), | ||
datetime(2022, 1, 1, 12, 1, 2), | ||
] |
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.
One last item - we should add a nan
value here like we do in IsLunchHour
just to confirm this primitive doesn't have issues with missing values.
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.
besides Nate's last comment, LGTM.
Adds the following datetime transform primitives:
--
IsWorkingHour
: Checks if hour is between configurable start and end times--
IsLunchTime
: Checks if hour is equal to configurable lunch time hourFixes #2076
Fixes #2078