optimization-dev / frontends /react /src /algorithms.ts
nhamid289's picture
Deploy optimisation from main (6727a1a)
c964813 verified
Raw History Blame Contribute Delete
447 Bytes
import type { ModelSpec } from "@elvis/ui";
import spec from "../../../backend/src/algorithms.json";
// The optimisers, from the spec shared with the Python backend. JSON imports
// type "kind" as string, so the shape is checked by backend/tests instead.
export const ALGORITHMS = spec.algorithms as unknown as ModelSpec[];
export function algorithmById(id: string): ModelSpec {
return ALGORITHMS.find((a) => a.id === id) ?? ALGORITHMS[0];
}