Remove testing asserts

This commit is contained in:
Manav Rathi
2024-10-23 14:42:55 +05:30
parent 9e09344163
commit b4643e9741

View File

@@ -418,7 +418,6 @@ export const _suggestionsAndChoicesForPerson = async (
const startTime = Date.now();
const personClusters = person.cgroup.data.assigned;
const personClusterIDs = new Set(personClusters.map(({ id }) => id));
const rejectedClusterIDs = new Set(
await savedRejectedClustersForCGroup(person.cgroup.id),
);
@@ -461,9 +460,6 @@ export const _suggestionsAndChoicesForPerson = async (
// Ignore singleton clusters.
if (faces.length < 2) continue;
// TODO-Cluster sanity check, remove after dev
if (personClusterIDs.has(id)) assertionFailed();
const sampledOtherEmbeddings = randomSample(faces, 50)
.map((id) => embeddingByFaceID.get(id))
.filter((e) => !!e);
@@ -676,21 +672,11 @@ export const _applyPersonSuggestionUpdates = async (
for (const [clusterID, assigned] of updates.entries()) {
switch (assigned) {
case true /* assign */:
// TODO-Cluster sanity check, remove after wrapping up dev
if (assignedClusters.find(({ id }) => id == clusterID)) {
assertionFailed();
}
assign(clusterID);
unrejectIfNeeded(clusterID);
break;
case false /* reject */:
// TODO-Cluster sanity check, remove after wrapping up dev
if (rejectedClusterIDs.includes(clusterID)) {
assertionFailed();
}
unassignIfNeeded(clusterID);
reject(clusterID);
break;