MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / grade

Function grade

benchmarks/audit/wester.ts:354–369  ·  view source on GitHub ↗
(c: Case, ref: (number | null)[], res: any)

Source from the content-addressed store, hash-verified

352 const t: any = { id: c.id, op: c.op, expr: mathJsonToWL(c.arg), var: c.varName, points: POINTS };
353 if (c.arg2 !== undefined) t.expr2 = mathJsonToWL(c.arg2);
354 if (c.point !== undefined && c.point !== null) t.point = wlPoint(c.point);
355 if (c.a !== undefined) t.a = c.a;
356 if (c.b !== undefined) t.b = c.b;
357 tasks.push(t);
358 } catch (e: any) {
359 by[c.id] = { status: 'error', error: String(e?.message ?? e).slice(0, 120) };
360 }
361 }
362 if (!tasks.length) return by;
363 const tmp = join(mkdtempSync(join(tmpdir(), 'wester-wl-')), 'spec.json');
364 writeFileSync(tmp, JSON.stringify({ real: true, tasks }));
365 try {
366 const out = execFileSync(NODE, [WOLFRAM_BATCH, tmp], { encoding: 'utf8', timeout: 1800000, maxBuffer: 64 * 1024 * 1024 });
367 for (const line of out.trim().split('\n')) { try { const o = JSON.parse(line); if (o.id) by[o.id] = o; } catch {} }
368 } catch (e: any) { console.error('wolfram failed:', (e.message || e).toString().split('\n')[0]); }
369 return by;
370}
371
372// --- grading (identical for every config) ----------------------------------

Callers 1

wester.tsFile · 0.85

Calls 2

isFiniteFunction · 0.85
absMethod · 0.65

Tested by

no test coverage detected