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.
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.
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.
Include case outside working hours but on a weekday
|
Changes:
|
thehomebrewnerd
left a comment
There was a problem hiding this comment.
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.
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.
ozzieD
left a comment
There was a problem hiding this comment.
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