You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our overlap_finder.find_all_common_intervals is able to take in a list of labeled Datetime Intervals (labelled with userid), and return a dictionary where the key is a common datetime interval (which we refer to as overlaps) , and the value is the set of userids that associate with that overlap. An example printout is shown in the code snippet below.
Mission:
We need to specify how datetime interval information should be passed to the bot as a string. Broadly, the question is how should you chat with the bot to pass it datetime interval information? Next, we need to write a parser to parse the bot's representation of a datetime interval into Interval objects that contain Datetime objects. We also need to attach user data to the Interval object for identifying who the interval is associated with.
Some approaches: explore libraries that parse natural language into datetimes, find or build a Telegram keyboard for datetime input, specify a fixed quick-and-easy string format.
Context:
Our
overlap_finder.find_all_common_intervals
is able to take in a list of labeled Datetime Intervals (labelled with userid), and return a dictionary where the key is a common datetime interval (which we refer to as overlaps) , and the value is the set of userids that associate with that overlap. An example printout is shown in the code snippet below.Mission:
We need to specify how datetime interval information should be passed to the bot as a string. Broadly, the question is how should you chat with the bot to pass it datetime interval information? Next, we need to write a parser to parse the bot's representation of a datetime interval into Interval objects that contain Datetime objects. We also need to attach user data to the Interval object for identifying who the interval is associated with.
Some approaches: explore libraries that parse natural language into datetimes, find or build a Telegram keyboard for datetime input, specify a fixed quick-and-easy string format.
Long-term goal:
Calendar Integration - integrate parser with calendar files (e.g. .ics files)
"""
tc_9 = [
Interval(dt(year=2018, month=1, day=1, hour=10), dt(year=2018, month=1, day=1, hour=12), "user_1"),
Interval(dt(year=2018, month=1, day=3, hour=10), dt(year=2018, month=1, day=3, hour=12), "user_1"),
Interval(dt(year=2018, month=1, day=1, hour=11), dt(year=2018, month=1, day=1, hour=13), "user_2"),
Interval(dt(year=2018, month=1, day=3, hour=11), dt(year=2018, month=1, day=3, hour=13), "user_2"),
Interval(dt(year=2018, month=1, day=1, hour=8), dt(year=2018, month=1, day=1, hour=18), "user_3"),
Interval(dt(year=2018, month=1, day=2, hour=8), dt(year=2018, month=1, day=2, hour=18), "user_3"),
Interval(dt(year=2019, month=1, day=1, hour=8), dt(year=2019, month=1, day=1, hour=18), "user_4"),
Interval(dt(year=2019, month=1, day=5, hour=0), dt(year=2019, month=1, day=6, hour=0), "user_4"),
Interval(dt(year=2019, month=1, day=5, hour=0), dt(year=2019, month=1, day=6, hour=0), "user_5"),
Interval(dt(year=2019, month=1, day=5, hour=0), dt(year=2019, month=1, day=6, hour=0), "user_5"),
Interval(dt(year=2019, month=1, day=5, hour=0), dt(year=2019, month=1, day=6, hour=0), "user_6")
]
test_algo(tc_9, format_date=True)
--- OUTPUT : ---
available common datetime intervals:
2018-Jan-01 1000 - 2018-Jan-01 1200:
userids: {'user_3', 'user_1'}
2018-Jan-01 1100 - 2018-Jan-01 1200:
userids: {'user_2', 'user_3', 'user_1'}
2018-Jan-03 1100 - 2018-Jan-03 1200:
userids: {'user_2', 'user_1'}
2019-Jan-05 0000 - 2019-Jan-06 0000:
userids: {'user_6', 'user_5', 'user_4'}
2018-Jan-01 1100 - 2018-Jan-01 1300:
userids: {'user_2', 'user_3'}
"""
The text was updated successfully, but these errors were encountered: