Skip to content

Commit 81dcb64

Browse files
authored
docs: documented transforms chunk_events_by_key and merge_events_by_keys (#99)
1 parent 220ff70 commit 81dcb64

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

aw_transform/chunk_events_by_key.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
def chunk_events_by_key(
1111
events: List[Event], key: str, pulsetime: float = 5.0
1212
) -> List[Event]:
13+
"""
14+
"Chunks" adjacent events together which have the same value for a key, and stores the
15+
original events in the :code:`subevents` key of the new event.
16+
"""
1317
chunked_events: List[Event] = []
1418
for event in events:
1519
if key not in event.data:

aw_transform/merge_events_by_keys.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77

88

99
def merge_events_by_keys(events, keys) -> List[Event]:
10-
# The result will be a list of events without timestamp since they are merged
10+
"""
11+
Sums the duration of all events which share a value for a key and returns a new event for each value.
12+
13+
.. note: The result will be a list of events without timestamp since they are merged.
14+
"""
1115
# Call recursively until all keys are consumed
1216
if len(keys) < 1:
1317
return events

0 commit comments

Comments
 (0)