Skip to content

Commit e6857fe

Browse files
Updated GroupedDataSubscriber comments
1 parent ce8d0a9 commit e6857fe

File tree

1 file changed

+9
-7
lines changed
  • examples/groupeddatasubscribe

1 file changed

+9
-7
lines changed

examples/groupeddatasubscribe/main.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ class GroupedDataSubscriber(Subscriber):
5353
5454
If incoming frame rate is higher than the samples per second, or timestamp alignment does not accurately coinside with
5555
the subsecond distribution, some data will be downsampled. Downsampled data count is tracked and reported to through the
56-
downsampledcount property.
56+
`downsampledcount` property.
5757
5858
Only a single one-second data buffer will be published at a time. If data cannot be processed within the one-second
59-
window, a warning message will be displayed and the data will be skipped. The number of skipped data sets is tracked
60-
and reported through the processmissedcount property.
59+
window, a warning message will be displayed and any new data will be skipped. The number of skipped data sets is tracked
60+
and reported through the `processmissedcount` property.
6161
6262
This example depends on a semi-accurate system clock to group data by timestamp. If the system clock is not accurate,
6363
data may not be grouped as expected.
@@ -346,7 +346,7 @@ def process_data(subscriber: GroupedDataSubscriber, timestamp: np.uint64, databu
346346
The function will only be called once per second with a buffer of grouped data for the second.
347347
If the function processing time exceeds the one second window, a warning message will be displayed
348348
and new data will be skipped. The number of skipped data sets is tracked and reported through the
349-
processmissed count property.
349+
`processmissedcount` property.
350350
351351
Parameters:
352352
timestamp: The timestamp, at top of second, for the grouped data
@@ -373,13 +373,15 @@ def process_data(subscriber: GroupedDataSubscriber, timestamp: np.uint64, databu
373373
# 2024-07-30 17:55:29.366
374374

375375
# At this point, all measurements are aligned to the same subsecond timestamp
376+
377+
# If you know which measurement you are looking for, you can use the following loopup:
378+
# measurement = measurements.get(my_signalid)
379+
380+
# Loop through each measurement in the subsecond time-aligned group
376381
for measurement in measurements.values():
377382
# To use UUID values, you can use the following loop instead:
378383
# for signalid, measurement in measurements.items():
379384

380-
# If you know which measurement you are looking for, you can use the following loopup:
381-
# measurement = measurements.get(my_signalid)
382-
383385
# Note:
384386
# measurement.value is a numpy float64
385387
# measurement.timestamp is a numpy uint64 (in ticks, i.e., 100-nanosecond intervals)

0 commit comments

Comments
 (0)