Check a spec without data#
Catch a broken spec file before you attach data or call a solver, on your machine and in CI.
- Run the check on one file.
A refusal prints its message on stderr and exits with status 1:
Advice is a note that does not stop the file from loading, so it prints on stdout and the command exits with status 0. A spec with no refusal and no advice prints nothing.
Variable 'slack' makes this spec unbounded: no constraint names it, and bounds.lower is open, and the +slack term in the minimize objective improves toward it.
Give it a finite bounds.lower, or the constraint that was meant to define it.
- Run it over every spec in CI. A refusal exits with status 1, so a shell loop is enough to fail the job:
- Ask from Python where the check is one step of a longer script.
to_specraises aMathSpecErrorfor anything the language refuses, andadvicereturns what it would print:
Without Python, the JSON schema checks the structure of the file, but nothing
inside an expression: or where: string
(editor completion and offline checking).