Page 1 of 1

Exporting .ses from Linear Circuit Builder

Posted: Mon Jul 19, 2021 1:02 pm
by ckelley
I'm trying to export a circuit I build in LinearCircuitBuilder as a .ses. I've only arranged and renamed the circuit elements. When I "Print Matrix Info" it return "Circuit equations have 0 inconsistencies". When I "Create class", however, I get the following warning:

Code: Select all

Unhandled exception in event loop:

Exception None
Press ENTER to continue...                                                                           
NEURON: no label on cell port
 near line 1
 {mkclass()}
^
)
)
)
)
Exception in gui thread
The .ses file that gets created is truncated, with the only executable / uncommented lines being:

Code: Select all

begintemplate LM
public install, refill

Also, those commented lines don't appear in a .ses file I exported from a simpler circuit. Not sure if this is due to a bug or an error on my part. If you have any suggestions, I'd greatly appreciate it.

Thanks,
Craig

Re: Exporting .ses from Linear Circuit Builder

Posted: Thu Jul 22, 2021 1:41 pm
by ted
ckelley was actually trying to use the Linear Circuit Builder to export a template (class definition in hoc) for a class that, when instantiated, would add to NEURON the equations that describe a circuit. That's different from saving a session file--a session file contains code that recreates one or more GUI objects. When working with NEURON's "builders" (CellBuilder, Linear Circuit builder, Network builder, whatever) it's always a good idea not just to export a template to save a ses file. This will be very useful in the future when one wants to revisit what one previously and try something new.

Anyway, back to this particular error message:
NEURON: no label on cell port
It turns out that, if one uses the Linear Circuit Builder to construct a circuit that involves a model cell, at least one "port" (think "where a wire or electrode is attached") on the model cell must be labeled. Labeling that port makes the membrane potential at that location available to hoc and Python in a special way that plays nicely with LinearMechanism.

When ckelly labeled the port (click on the Label radio button, select Change label, click on the cell icon's "electrode", then enter the name you want to apply to voltage at that point. "Vm" is often a reasonable choice), presto! the next time he tried exporting a template, it worked! And he also saved the Linear Circuit Builder to a ses file, and everybody lived happily ever after.