If nmodl sends invalid code to SymPy, SymPy we throw an exception. NMODL ignores the issue, prints a warning; and them much later fails. Typical output might be:
[NMODL] [warning] :: SympySolverVisitor :: solve_non_lin_system python exception: Sympify of expression 'could not parse 'is'' failed, because of exception being raised:
SyntaxError: invalid syntax (<string>, line 1)
[NMODL] [warning] :: SympySolverVisitor :: solve_non_lin_system python exception: Sympify of expression 'could not parse 'is'' failed, because of exception being raised:
SyntaxError: invalid syntax (<string>, line 1)
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
[NMODL] [error] :: NeuronSolveVisitor :: solver method 'sparse' not supported
terminate called after throwing an instance of 'std::runtime_error'
what(): PRIME encountered during code generation, ODEs not solved?
Aborted
The first two lines are important, the next 20+ lines are spam; and the final error message is outright misleading.
Therefore, this PR proposes to simply throw if SymPy fails.
If
nmodl
sends invalid code to SymPy, SymPy we throw an exception. NMODL ignores the issue, prints a warning; and them much later fails. Typical output might be:The first two lines are important, the next 20+ lines are spam; and the final error message is outright misleading.
Therefore, this PR proposes to simply throw if SymPy fails.