Skip to content

Commit e1c5ae0

Browse files
committed
Revert "Get rid of TS record count check"
This reverts commit 1e48c39.
1 parent 1e48c39 commit e1c5ae0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

utils/summarize.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -462,13 +462,13 @@ export const handler: Handler = async (event: any, context?: any) => {
462462
const ts = new Trueskill({betaStart: 25/9});
463463
const tsResults = ts.runProcessed(recs);
464464
const tsRatings = new Map(tsResults.ratings) as Map<string, ITrueskillRating>;
465-
// if (aggRatingList.filter(r => r.user === player).length !== tsRatings.size) {
466-
// const elo = new Set<string>(aggRatingList.map(r => r.user));
467-
// const tsVals = new Set<string>([...tsRatings.values()].map(r => {const [,u] = r.userid.split("|"); return u;}))
468-
// const inElo = [...elo.values()].filter(u => ! tsVals.has(u));
469-
// const inTS = [...tsVals.values()].filter(u => ! elo.has(u));
470-
// throw new Error(`The list of Elo ratings is not the same length as the list of Trueskill ratings.\nList of Elo ratings not in Trueskill: ${JSON.stringify(inElo, null, 2)}\nList of Trueskill ratings not in Elo: ${JSON.stringify(inTS, null, 2)}\nTrueskill ratings: ${JSON.stringify(tsRatings, replacer, 2)}`);
471-
// }
465+
if (aggRatingList.filter(r => r.user === player).length !== tsRatings.size) {
466+
const elo = new Set<string>(aggRatingList.map(r => r.user));
467+
const tsVals = new Set<string>([...tsRatings.values()].map(r => {const [,u] = r.userid.split("|"); return u;}))
468+
const inElo = [...elo.values()].filter(u => ! tsVals.has(u));
469+
const inTS = [...tsVals.values()].filter(u => ! elo.has(u));
470+
throw new Error(`The list of Elo ratings is not the same length as the list of Trueskill ratings.\nList of Elo ratings not in Trueskill: ${JSON.stringify(inElo, null, 2)}\nList of Trueskill ratings not in Elo: ${JSON.stringify(inTS, null, 2)}\nTrueskill ratings: ${JSON.stringify(tsRatings, replacer, 2)}`);
471+
}
472472
console.log(`Final Trueskill ratings:\n${JSON.stringify([...tsRatings.values()])}`)
473473

474474
// now Glicko

0 commit comments

Comments
 (0)