Skip to content

Commit

Permalink
test schedule trips/hr func in nb
Browse files Browse the repository at this point in the history
  • Loading branch information
edasmalchi committed Nov 4, 2024
1 parent 0c3250d commit ed23eba
Show file tree
Hide file tree
Showing 3 changed files with 1,297 additions and 406 deletions.
5 changes: 5 additions & 0 deletions _shared_utils/shared_utils/rt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ def categorize_time_of_day(value: Union[int, dt.datetime]) -> str:
else:
return "Evening"

def time_of_day_durations():
"""
Get duration in hours of each time of day classification.
"""
return pd.Series([categorize_time_of_day(x) for x in range(25)]).value_counts()

@jit(nopython=True) # numba gives huge speedup here (~60x)
def time_at_position_numba(desired_position, shape_array, dt_float_array):
Expand Down
Loading

0 comments on commit ed23eba

Please sign in to comment.