diff --git a/pyneuroml/neuron/mview_neuroml2.hoc b/pyneuroml/neuron/mview_neuroml2.hoc index 345ba528..52990879 100644 --- a/pyneuroml/neuron/mview_neuroml2.hoc +++ b/pyneuroml/neuron/mview_neuroml2.hoc @@ -53,6 +53,7 @@ proc init() {local i nrnpython("from pyneuroml.neuron.nrn_export_utils import get_segment_group_name") nrnpython("from pyneuroml.neuron.nrn_export_utils import set_erev_for_mechanism") nrnpython("from pyneuroml.neuron.nrn_export_utils import get_erev_for_mechanism") + nrnpython("from pyneuroml.neuron.nrn_export_utils import NO_REV") nrnpython("from neuron import h") } @@ -540,19 +541,6 @@ proc xmlwrite_biophysics() { print "---------------------------------------------" print "Handling mechanism: ", dmech.name - strdef passiveAttr - passiveAttr = "" - // If mech name is built in passive conductance in NEURON - if (strcmp(dmech.name,"pas") == 0) { - // Not used in nml2 - //////passiveAttr = " passive_conductance=\"true\"" - } - // If mech name is default passive conductance from neuroConstruct - if (strcmp(dmech.name,"LeakConductance") == 0) { - // Not used in nml2 - /////passiveAttr = " passive_conductance=\"true\"" - } - for j=0, dmech.location.subset.size()-1 { secref = cellref.secanal.all.object(dmech.location.subset.x(j)) // printsec(cellnml2file, secref) @@ -633,8 +621,8 @@ proc xmlwrite_biophysics() { if (strcmp(paramNameToUse, "condDensity")==0) { - cellnml2file.printf(" =0) { @@ -643,7 +631,9 @@ proc xmlwrite_biophysics() { cellnml2file.printf(" erev=\"%fmV\" ", erev_K) } else { value = p.get_erev_for_mechanism(dmech.name) - cellnml2file.printf(" erev=\"%fmV\" ", value) + if (value && value != p.NO_REV) { + cellnml2file.printf(" erev=\"%fmV\" ", value) + } } cellnml2file.printf("/>\n\n") diff --git a/pyneuroml/neuron/nrn_export_utils.py b/pyneuroml/neuron/nrn_export_utils.py index c6ccd2b4..3f1e07d5 100644 --- a/pyneuroml/neuron/nrn_export_utils.py +++ b/pyneuroml/neuron/nrn_export_utils.py @@ -33,6 +33,8 @@ def get_segment_group_name(nrn_section_name): mechs_vs_erevs = {} +NO_REV = float('inf') + def set_erev_for_mechanism(mech, erev): mechs_vs_erevs[mech] = erev print(">> mechs_vs_erevs: %s"%mechs_vs_erevs) @@ -40,7 +42,7 @@ def set_erev_for_mechanism(mech, erev): def get_erev_for_mechanism(mech): print(">> mechs_vs_erevs: %s"%mechs_vs_erevs) - return mechs_vs_erevs[mech] + return mechs_vs_erevs.get(mech, NO_REV) if __name__ == '__main__':