Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions awpy/parsers/rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ def apply_round_num(df: pl.DataFrame, rounds_df: pl.DataFrame, tick_col: str = "
"round_num" column that indicates the round in which the event occurs. If no
matching round is found, "round_num" will be null.
"""
# prevents InvalidOperationError on some demos in which the tick column isn't pre-sorted
df = df.sort(tick_col)

# Use join_asof to get the round where round.start <= event.tick.
# This join will add the columns 'round_num', 'start', and 'end' from rounds_df.
df_with_round = df.join_asof(
Expand Down
Loading