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 an error when using derivimplicit with PROCEDURE block #1383

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

JCGoran
Copy link
Contributor

@JCGoran JCGoran commented Aug 2, 2024

The following modfile does not work with NOCMODL:

: mwe.mod
NEURON	{
	SUFFIX example
}

BREAKPOINT	{
    SOLVE myfunc METHOD derivimplicit
}

PROCEDURE myfunc() {}

With the error:

Error: Method derivimplicit can't be used with Block myfunc at line 10 in file mwe.mod

On the other hand, nmodl --neuron mwe.mod just segfaults with no useful error; with debugging symbols, I get a slightly more verbose backtrace:

Assertion failed: (node_to_solve->get_node_type() == ast::AstNodeType::DERIVATIVE_BLOCK), function create_solution_expression, file solve_block_visitor.cpp, line 59

This PR fixes it so it actually throws a runtime_error with the traceback:

terminating due to uncaught exception of type std::runtime_error: Method derivimplicit cannot be used for ProcedureBlock block myfunc

bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Aug 2, 2024
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.74%. Comparing base (86c2c66) to head (a14ffe2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1383   +/-   ##
=======================================
  Coverage   86.73%   86.74%           
=======================================
  Files         180      180           
  Lines       13675    13685   +10     
=======================================
+ Hits        11861    11871   +10     
  Misses       1814     1814           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bbpbuildbot

This comment has been minimized.

@1uc
Copy link
Collaborator

1uc commented Aug 5, 2024

This could either be tested via Catch2 or we can setup a directory tests/invalid_mod_files to collect numerous invalid modfiles, that we run similarly to the usecases.

bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Aug 12, 2024
@bbpbuildbot
Copy link
Collaborator

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

Status and direct links:

@JCGoran JCGoran force-pushed the jelic/fix_derivimplicit_procedure branch from de50a62 to a14ffe2 Compare August 12, 2024 08:15
@JCGoran JCGoran marked this pull request as ready for review August 12, 2024 08:26
bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Aug 12, 2024
@JCGoran JCGoran merged commit 509416e into master Aug 12, 2024
24 checks passed
@JCGoran JCGoran deleted the jelic/fix_derivimplicit_procedure branch August 12, 2024 13:38
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.

3 participants