Skip to content

Commit d000dfa

Browse files
committed
Improved docs.
1 parent 602d408 commit d000dfa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

PostProcessing/PostProcessVideos.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,25 @@ def main(input_dir: Path, output_dir: Path):
7979

8080
#
8181
# Find all CSV files in the directory and read it into a data frame
82+
# Use the following regular expression to check of the client ID is a 16-digit hexadecimal.
8283
clientIDpattern = "[\\da-f]" * 16
8384
patt = re.compile("^" + clientIDpattern + "$")
8485

86+
# Fill this list with the client IDs found n the directory
8587
clientIDs: List[str] = []
8688
for p in input_dir.iterdir():
89+
# Check if the ClientID complies to the numerical format (using regex).
8790
res = patt.match(p.stem)
8891
if res:
8992
print("Found client -->", p.stem)
90-
# TODO -- we could also check if the ClientID complies to the numerical format (using regex).
9193
clientIDs.append(p.stem)
9294
else:
9395
print("Discarding ", p.stem)
9496

9597
n_clients = len(clientIDs)
9698

97-
# Will accumulate the list of dataframes and mp4 files in the same order of the client IDs.
99+
#
100+
# Accumulates the list of dataframes and mp4 files in the same order of the client IDs.
98101
df_list: List[pd.DataFrame] = []
99102
mp4_list: List[str] = []
100103

@@ -142,8 +145,7 @@ def main(input_dir: Path, output_dir: Path):
142145

143146
#
144147
# Trim CSVs (TODO)
145-
# Trim the data frames to the time range and save to new CSV files
146-
# TODO -- actually, we don't need to save them. We could just return them as DataFrame instances
148+
# Trim the data frames to the time range
147149
trimmed_dataframes = trim_into_interval(repaired_df_list, min_common, max_common, THRESHOLD_NS)
148150

149151
assert len(clientIDs) == len(trimmed_dataframes), f"Expected {len(clientIDs)} trimmed dataframes. Found f{len(trimmed_dataframes)}"

0 commit comments

Comments
 (0)