Check a model without data#
Refuse a broken model file before any data or solver is involved, 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 prints on stdout and exits with status 0. A model the language accepts with nothing to advise prints nothing.
Variable 'slack' makes this model unbounded: no constraint names it, and bounds.lower is open, which is the direction a +slack term improves a minimize objective in. No data can change that, so the solve would answer `unbounded` and name nothing.
Give it a finite bounds.lower, or the constraint that was meant to define it.
- Run it over every model in CI. The exit status is the gate, so a shell loop is the whole 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 file's structure and nothing
inside an expression: or where: string
(editor completion and offline checking).