Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw on fatal error. #1257

Closed
wants to merge 2 commits into from
Closed

Throw on fatal error. #1257

wants to merge 2 commits into from

Conversation

1uc
Copy link
Collaborator

@1uc 1uc commented May 13, 2024

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.

@bbpbuildbot
Copy link
Collaborator

Logfiles from GitLab pipeline #210641 (:no_entry:) have been uploaded here!

Status and direct links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants