Validate drug-block channel labelling upfront instead of deep in the concentration loop#42
Conversation
Co-authored-by: mirams <858776+mirams@users.noreply.github.com>
|
@copilot that might solve one problem, but do you know why the error was being written to the previous concentration error log file instead of the one of interest? |
Yes — it's not tied to concentration at all. |
|
@copilot if the check is now done earlier, can it be removed from the loop over concentration code? |
Co-authored-by: mirams <858776+mirams@users.noreply.github.com>
Requesting a block on a channel not labelled in the model (e.g.
--pic50-nalon a model withoutmembrane_persistent_sodium_current_conductance) only threw once the simulation reached a non-zero concentration, since the check lived inApplyDrugBlockand only fired whenconductance_factor < 1. Atconc=0,conductance_factoris exactly1, so the run appeared to succeed for the control concentration and only failed later — making it look like the error was tied to a specific concentration's log file, when in factchaste_errors_<rank>.txtis named by process rank, not concentration.Fix
ReadInIC50HillAndSaturation, firing as soon as a block is requested via--ic50-X/--pic50-Xfor a channel the model doesn't expose (respecting the existingParameterWrapperIto fallback rename).Example
now fails immediately with
... does not have the current "membrane_persistent_sodium_current_conductance" labelled, but you have requested a block on this channel.instead of running through conc=0 first.Tests
test/TestApPredict.hppreproducing the issue's CLI arguments and asserting the exception is raised.