Added Preflights

This commit is contained in:
=
2025-08-26 17:12:06 -04:00
committed by brotoskyj
parent 708a7e9061
commit 751ce4863c
4 changed files with 155 additions and 36 deletions
+16 -1
View File
@@ -115,4 +115,19 @@ def filepathInitialGroup(df: pd.DataFrame):
path_eligible = deduplicate_lists(path_eligible)
path_ineligible = deduplicate_lists(path_ineligible)
return path_eligible, path_ineligible
return path_eligible, path_ineligible
def filter_and_drop(approved, eligiblepaths, min_hashes):
"""
Filters eligiblepaths to rows where all hashes are in approved,
then drops rows with fewer than min_hashes hashes.
"""
approved_hashes = set(approved['sha256'])
def all_hashes_approved(row):
return all(h in approved_hashes for h in row['sha256'])
filtered = eligiblepaths[eligiblepaths.apply(all_hashes_approved, axis=1)]
filtered = filtered[filtered['sha256'].apply(len) >= min_hashes]
return filtered