File size: 1,001 Bytes
c964813
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Type-checks the contract examples (backend/contract/*.json) against
// OptimisationApi when tsc runs. Never imported by the app.
// The Python side is checked by backend/tests/test_contract.py.
import type { ContractExample } from "@elvis/pyodide";

import type { OptimisationApi } from "./python.ts";
import gradientDescentQuadratic from "../../../backend/contract/gradient_descent_quadratic.json";
import invalidFunction from "../../../backend/contract/invalid_function.json";
import newtonSingularHessian from "../../../backend/contract/newton_singular_hessian.json";
import pastTheEnd from "../../../backend/contract/past_the_end.json";

gradientDescentQuadratic satisfies ContractExample<OptimisationApi, typeof gradientDescentQuadratic>;
invalidFunction satisfies ContractExample<OptimisationApi, typeof invalidFunction>;
newtonSingularHessian satisfies ContractExample<OptimisationApi, typeof newtonSingularHessian>;
pastTheEnd satisfies ContractExample<OptimisationApi, typeof pastTheEnd>;