Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 6fddc82

Browse files
Merge pull request #486 from BlueBrain/jinja-template
update jinja template to have getCell function
2 parents e05921d + e9f01c7 commit 6fddc82

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

bluepyopt/ephys/templates/cell_template.jinja2

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ begintemplate {{template_name}}
4242
public all, somatic, apical, axonal, basal, myelinated, APC
4343
objref all, somatic, apical, axonal, basal, myelinated, APC
4444

45+
obfunc getCell(){
46+
return this
47+
}
48+
4549
proc init(/* args: morphology_dir, morphology_name */) {
4650
all = new SectionList()
4751
apical = new SectionList()
@@ -120,6 +124,7 @@ proc distribute_distance(){local x localobj sl
120124
this.soma[0] distance(0, 0.5)
121125
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
122126
forsec sl for(x, 0) {
127+
// use distance(x) twice for the step distribution case, e.g. for calcium hotspot
123128
sprint(stmp, distfunc, secname(), x, distance(x), distance(x))
124129
execute(stmp)
125130
}

examples/stochkv/stochkv3cell.hoc

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ begintemplate stochkv3_cell
2727
public all, somatic, apical, axonal, basal, myelinated, APC
2828
objref all, somatic, apical, axonal, basal, myelinated, APC
2929

30+
obfunc getCell(){
31+
return this
32+
}
33+
3034
proc init(/* args: morphology_dir, morphology_name */) {
3135
all = new SectionList()
3236
apical = new SectionList()
@@ -98,6 +102,7 @@ proc distribute_distance(){local x localobj sl
98102
this.soma[0] distance(0, 0.5)
99103
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
100104
forsec sl for(x, 0) {
105+
// use distance(x) twice for the step distribution case, e.g. for calcium hotspot
101106
sprint(stmp, distfunc, secname(), x, distance(x), distance(x))
102107
execute(stmp)
103108
}

examples/stochkv/stochkv3cell_det.hoc

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ begintemplate stochkv3_cell
2727
public all, somatic, apical, axonal, basal, myelinated, APC
2828
objref all, somatic, apical, axonal, basal, myelinated, APC
2929

30+
obfunc getCell(){
31+
return this
32+
}
33+
3034
proc init(/* args: morphology_dir, morphology_name */) {
3135
all = new SectionList()
3236
apical = new SectionList()
@@ -98,6 +102,7 @@ proc distribute_distance(){local x localobj sl
98102
this.soma[0] distance(0, 0.5)
99103
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
100104
forsec sl for(x, 0) {
105+
// use distance(x) twice for the step distribution case, e.g. for calcium hotspot
101106
sprint(stmp, distfunc, secname(), x, distance(x), distance(x))
102107
execute(stmp)
103108
}

examples/stochkv/stochkvcell.hoc

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ begintemplate stochkv_cell
2727
public all, somatic, apical, axonal, basal, myelinated, APC
2828
objref all, somatic, apical, axonal, basal, myelinated, APC
2929

30+
obfunc getCell(){
31+
return this
32+
}
33+
3034
proc init(/* args: morphology_dir, morphology_name */) {
3135
all = new SectionList()
3236
apical = new SectionList()
@@ -98,6 +102,7 @@ proc distribute_distance(){local x localobj sl
98102
this.soma[0] distance(0, 0.5)
99103
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
100104
forsec sl for(x, 0) {
105+
// use distance(x) twice for the step distribution case, e.g. for calcium hotspot
101106
sprint(stmp, distfunc, secname(), x, distance(x), distance(x))
102107
execute(stmp)
103108
}

examples/stochkv/stochkvcell_det.hoc

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ begintemplate stochkv_cell
2727
public all, somatic, apical, axonal, basal, myelinated, APC
2828
objref all, somatic, apical, axonal, basal, myelinated, APC
2929

30+
obfunc getCell(){
31+
return this
32+
}
33+
3034
proc init(/* args: morphology_dir, morphology_name */) {
3135
all = new SectionList()
3236
apical = new SectionList()
@@ -98,6 +102,7 @@ proc distribute_distance(){local x localobj sl
98102
this.soma[0] distance(0, 0.5)
99103
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
100104
forsec sl for(x, 0) {
105+
// use distance(x) twice for the step distribution case, e.g. for calcium hotspot
101106
sprint(stmp, distfunc, secname(), x, distance(x), distance(x))
102107
execute(stmp)
103108
}

0 commit comments

Comments
 (0)