Skip to content

Checks and errors

Checks

tenqsp.validate.validate(ir, *, raise_on_error=True)

Check a model; return a Report (raise ModelError on errors by default).

tenqsp.validate.Report dataclass

What m.validate(), tq.validate(ir) and m.diagnostics() found: issues (each with level, where and message), and the same split by level in errors, warnings and notes. ok is true when there are no errors. print(report) lists every issue, one per line.

tenqsp.ModelIR dataclass

A complete model description.

Exceptions

tenqsp.ModelError

Bases: ValueError

Raised when a model has errors; the message lists all of them.

tenqsp.NotationError

Bases: ModelError

A model text cannot be read. The message lists every problem with its line.

tenqsp.FormulaError

Bases: ValueError

A formula cannot be accepted. The message says what is wrong, where, and how to fix it.

tenqsp.CompileError

Bases: ValueError

The model is valid but uses something the compiler cannot build yet.

tenqsp.MissingValues

Bases: ValueError

Parameters declared without a value were not given one.

tenqsp.SolverError

Bases: RuntimeError

The integrator failed; the message says where and what was tried.

Warnings

tenqsp.NegativeValuesWarning

Bases: UserWarning

A state went below zero by more than its tolerance allows (beyond -10 x atol), while its values are otherwise far larger: an undershoot the solver did not control, which growth or selection can amplify until the run fails. Silence it as any warning: warnings.filterwarnings("ignore", category=tq.NegativeValuesWarning).

Known issues and updates

tenqsp.known_issues(*, show=True)

The known problems of the installed version, from the list shipped with it (no network).

show=True prints them, the ones that can change results first; show=False returns them as a list of dicts (fields id, title, area, introduced, fixed_in, changes_results, details, workaround). Problems found after this version was released are not in its list: tq.check_updates() reads the newest one.

tenqsp.check_updates(*, show=True)

Ask PyPI whether a newer TenQSP exists, and what it fixes. Needs the network; runs only when called.

With a newer version, lists the fixes since the installed one that can change results, then the other fixes, the problems still open, and the new features. show=False returns the same as a dict: installed, latest, fixes_that_change_results, other_fixes, open_issues, features (lists) and error (None, or why PyPI or the newest version's list could not be read). Nothing is installed or changed.