comnum.verify_spec#

comnum.verify_spec(spec, *, threads=None, progress=False, report_path=None)#

Run a specification and check its expected results (closed forms, published curves).

Parameters:
  • spec (str | os.PathLike | dict) – as for run_spec; it must have an expect list.

  • threads (int, optional) – worker threads.

  • progress (bool) – print one line per condition.

  • report_path (str | os.PathLike | None) – write the verification report there, the JSON file of comnum verify.

Returns:

results (a list of dicts, as run_spec), checks (one dict per check with name, source, condition, metric, expected, value, lo, hi, passed) and passed (all checks passed).

Return type:

dict

Raises:
  • ValueError – for a specification without expectations, an invalid one, or an expectation that checks no condition.

  • OSError – if the report cannot be written.