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
+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;