Remove standards config fallback and implement caching

This commit is contained in:
Dominic Ferrando
2026-07-06 11:42:12 -04:00
parent 49f4f209a6
commit 756e4f86d9
10 changed files with 95 additions and 5476 deletions
File diff suppressed because it is too large Load Diff
@@ -1,79 +0,0 @@
{
"global": {
"maxLevel": 100
},
"activity": {
"BackSquat": {
"enableGeneration": true,
"weightModifier": 0,
"weightSkew": 0,
"ageModifier": 0,
"difficultyModifier": 0.3,
"peakAge": 0,
"stretch": {
"upper": 0,
"lower": 1
}
},
"BenchPress": {
"enableGeneration": true,
"weightModifier": 0,
"weightSkew": 0,
"ageModifier": 0,
"difficultyModifier": 0.05,
"peakAge": 0,
"stretch": {
"upper": 1,
"lower": 0
}
},
"Deadlift": {
"enableGeneration": true,
"weightModifier": 0,
"weightSkew": 0,
"ageModifier": 0,
"difficultyModifier": -0.05,
"peakAge": 0,
"stretch": {
"upper": 1,
"lower": 0
}
},
"Run": {
"enableGeneration": true,
"weightModifier": 0.1,
"weightSkew": 0,
"ageModifier": 0,
"difficultyModifier": 0.35,
"peakAge": 0,
"stretch": {
"upper": 1,
"lower": 1
}
},
"BroadJump": {
"enableGeneration": true,
"weightModifier": -0.1,
"weightSkew": 0,
"ageModifier": -0.25,
"difficultyModifier": -0.15,
"peakAge": 23,
"stretch": {
"upper": 3,
"lower": 1
}
},
"ConeDrill": {
"enableGeneration": true,
"weightModifier": -0.1,
"weightSkew": 0,
"ageModifier": -0.25,
"difficultyModifier": 0.15,
"peakAge": 23,
"stretch": {
"upper": 0,
"lower": 2
}
}
}
}
+1 -11
View File
@@ -10,11 +10,8 @@ import {
type Player,
} from "@blade-and-brawn/domain";
import { levenbergMarquardt as LM } from "ml-levenberg-marquardt";
import defaultStandardsParamsJson from "./data/standards/fallback-params.json" with { type: "json" };
import defaultStandardsDataJson from "./data/standards/fallback-data.json" with { type: "json" };
import { getAvgWeight } from "./avg-weights";
import { StandardsDataSchema, StandardsParamsSchema, type LevelCalculatorOutput, type Levels, type NumberMetric, type Standard, type StandardsConfig, type StandardsData } from "./models";
import { Value } from "@sinclair/typebox/value";
import { type LevelCalculatorOutput, type Levels, type NumberMetric, type Standard, type StandardsConfig, type StandardsData } from "./models";
// SOURCES
// Squat, Bench, Dead Lift:
@@ -34,13 +31,6 @@ const metricPriority = (m: NumberMetric) => {
return 2;
};
Value.Assert(StandardsDataSchema, defaultStandardsDataJson);
Value.Assert(StandardsParamsSchema, defaultStandardsParamsJson);
export const FALLBACK_STANDARDS_CONFIG: StandardsConfig = {
data: defaultStandardsDataJson,
params: defaultStandardsParamsJson
};
export class LevelCalculator {
Standards: Standards;