Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2c6503d
Format code
CMEONE Apr 5, 2025
f5a93f4
create a picklist option
25DanielG Apr 14, 2025
594f627
Format code
25DanielG Apr 14, 2025
24fe7b6
add picklist export button
25DanielG Apr 14, 2025
eefcdea
merge
25DanielG Apr 14, 2025
a512814
Format code
25DanielG Apr 14, 2025
5bb5727
remove some logging
25DanielG Apr 16, 2025
c4d31cb
Format code
25DanielG Apr 16, 2025
b348511
use weighted average in picklist
25DanielG Apr 16, 2025
d7159f0
Merge remote-tracking branch 'refs/remotes/origin/picklist' into pick…
25DanielG Apr 16, 2025
1f4da43
Format code
25DanielG Apr 16, 2025
8083581
change feature name
25DanielG Apr 17, 2025
fa50814
Format code
25DanielG Apr 17, 2025
83da32b
Merge pull request #493 from The-Purple-Warehouse/picklist
25DanielG Apr 17, 2025
a258cd7
Merge pull request #494 from The-Purple-Warehouse/main
25DanielG Apr 17, 2025
9f4b766
Format code
25DanielG Apr 17, 2025
585cf6c
fix typo
25DanielG Apr 17, 2025
d8391cf
Merge pull request #495 from The-Purple-Warehouse/main
25DanielG Apr 17, 2025
374a709
Format code
25DanielG Apr 17, 2025
0151bb9
updated levels
benjaminxiaa Aug 12, 2025
ca83af6
Update CODEOWNERS
CMEONE Aug 13, 2025
83eeb73
Format code
benjaminxiaa Aug 15, 2025
87b8bd0
Merge pull request #496 from The-Purple-Warehouse/main
benjaminxiaa Aug 17, 2025
75acdca
Publish and freeze TPW for 2025
CMEONE Jan 10, 2026
7fb9478
Updated to 2026 game: Rebuilt.
benjaminxiaa Jan 10, 2026
a35d353
Format code
benjaminxiaa Jan 10, 2026
9988ac2
Merge pull request #498 from The-Purple-Warehouse/rebuilt-2026
benjaminxiaa Jan 11, 2026
29b51b5
Format code
benjaminxiaa Jan 11, 2026
3cd069b
Merge pull request #499 from The-Purple-Warehouse/main
benjaminxiaa Jan 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @CMEONE @25DanielG
* @CMEONE @benjaminxiaa
2 changes: 1 addition & 1 deletion config/development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const config: Config = {
adminTokens: secret.development.auth.adminTokens
},
features: ["scouting", "resources", "tps"],
year: 2025
year: 2026
};

export default config;
30 changes: 30 additions & 0 deletions config/examplesecret.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,35 @@
"admin": "admin"
}
}
},
"production2025": {
"db": {
"database": "tpw-prod",
"username": "",
"password": "",
"host": "localhost",
"port": 27017
},
"auth": {
"cookieKeys": ["1", "2", "3", "4", "I declare a thumb war"],
"access": {
"restricted": false,
"username": "admin",
"password": "admin"
},
"ci": {
"deploy": ""
},
"scoutingKeys": ["1", "2", "3", "4", "I declare a thumb war"],
"tba": "",
"scoutingAdmins": ["admin"],
"scoutingInternal": {
"teamNumber": "admin",
"accessToken": "admin"
},
"adminTokens": {
"admin": "admin"
}
}
}
}
5 changes: 4 additions & 1 deletion config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import staging from "./staging";
import production from "./production";
import production2023 from "./production2023";
import production2024 from "./production2024";
import production2025 from "./production2025";

const env = process.env.NODE_ENV || "development";

Expand All @@ -12,14 +13,16 @@ if (
"staging",
"production",
"production2023",
"production2024"
"production2024",
"production2025"
].includes(env)
)
throw new Error(`Config file for environment ${env} could not be found.`);
const config: Config = {
production,
production2023,
production2024,
production2025,
staging,
development
}[env];
Expand Down
2 changes: 1 addition & 1 deletion config/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const config: Config = {
db: secret.production.db,
auth: secret.production.auth,
features: ["scouting", "tps"],
year: 2025
year: 2026
};

export default config;
17 changes: 17 additions & 0 deletions config/production2025.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Config } from ".";
// @ts-ignore
import secret from "./secret";

const config: Config = {
branch: "2025",
server: {
port: 18925,
domain: "2025.thepurplewarehouse.com"
},
db: secret.production2025.db,
auth: secret.production2025.auth,
features: ["scouting", "tps"],
year: 2025
};

export default config;
122 changes: 122 additions & 0 deletions config/scouting/2025/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,127 @@ export function formatParsedData(data, categories, teams) {
.join("\n")}`;
}

export interface picklist {
team: string;
"avg-auto-pieces": number;
"avg-tele-pieces": number;
"avg-l1": number;
"avg-l2": number;
"avg-l3": number;
"avg-l4": number;
"avg-proc": number;
"avg-net": number;
"deep-climbs": number;
}

export async function formPicklist(
data: { [team: string]: any[] },
categories,
teams: any[]
) {
let analysis: picklist[] = [];
console.log(teams);
for (const t1 of teams) {
const t = t1.team_number;
let dat = data[t];
if (!dat) continue;
let autoPieces = 0;
let telePieces = 0;
let l1 = 0;
let l2 = 0;
let l3 = 0;
let l4 = 0;
let proc = 0;
let net = 0;
let deepClimbs = 0;
let total = 0;
for (const d of dat) {
if (!d || !d.accuracy || !d.accuracy.calculated) {
continue;
}
let acc = d.accuracy.percentage;

autoPieces += acc * find(d, "counters", categories, "25-20", 0);
telePieces += acc * find(d, "counters", categories, "25-24", 0);
let autocoral = find(d, "data", categories, "25-18", []);
let telecoral = find(d, "data", categories, "25-22", []);
let autol4 = autocoral.filter((el) => el == 0).length;
let autol3 = autocoral.filter((el) => el == 1).length;
let autol2 = autocoral.filter((el) => el == 2).length;
let autol1 = autocoral.filter((el) => el == 3).length;
let telel4 = telecoral.filter((el) => el == 0).length;
let telel3 = telecoral.filter((el) => el == 1).length;
let telel2 = telecoral.filter((el) => el == 2).length;
let telel1 = telecoral.filter((el) => el == 3).length;
l1 += acc * (autol1 + telel1);
l2 += acc * (autol2 + telel2);
l3 += acc * (autol3 + telel3);
l4 += acc * (autol4 + telel4);
let autoalgae = find(d, "data", categories, "25-17", []);
let telealgae = find(d, "data", categories, "25-21", []);
let autoNe = autoalgae.filter((el) => el == 4).length;
let autoPr = autoalgae.filter((el) => el == 5).length;
let teleNe = telealgae.filter((el) => el == 4).length;
let telePr = telealgae.filter((el) => el == 5).length;
net += acc * (autoNe + teleNe);
proc += acc * (autoPr + telePr);
let climb = find(d, "abilities", categories, "25-8", 0);
if (acc > 0.5) deepClimbs += climb == 3 ? 1 : 0;

total += acc;
}
if (dat.length == 0 || total == 0) {
analysis.push({
team: t,
"avg-auto-pieces": NaN,
"avg-tele-pieces": NaN,
"avg-l1": NaN,
"avg-l2": NaN,
"avg-l3": NaN,
"avg-l4": NaN,
"avg-proc": NaN,
"avg-net": NaN,
"deep-climbs": NaN
});
} else {
analysis.push({
team: t,
"avg-auto-pieces": autoPieces / total,
"avg-tele-pieces": telePieces / total,
"avg-l1": l1 / total,
"avg-l2": l2 / total,
"avg-l3": l3 / total,
"avg-l4": l4 / total,
"avg-proc": proc / total,
"avg-net": net / total,
"deep-climbs": deepClimbs
});
}
}

return formatPicklist(analysis);
}

function formatPicklist(analysis) {
return `entry,team,"avg auto pieces","avg tele pieces","avg l1","avg l2","avg l3","avg l4","avg processor","avg net","# of deep climbs"\n${analysis
.map((entry, i) => {
return [
i,
entry.team || 0,
entry["avg-auto-pieces"],
entry["avg-tele-pieces"],
entry["avg-l1"],
entry["avg-l2"],
entry["avg-l3"],
entry["avg-l4"],
entry["avg-proc"],
entry["avg-net"],
entry["deep-climbs"]
].join(",");
})
.join("\n")}`;
}

export function notes() {
return ``;
}
Expand Down Expand Up @@ -1547,6 +1668,7 @@ const scouting2025 = {
preload,
formatData,
formatParsedData,
formPicklist,
notes,
analysis,
compare,
Expand Down
5 changes: 5 additions & 0 deletions config/scouting/2026/exampleaccuracy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let accuracy = async function (event, matches, data, categories, teams) {
return {};
};

export default accuracy;
Loading