Skip to content
Snippets Groups Projects
Unverified Commit 13c9daa2 authored by Aurélien Jaquier's avatar Aurélien Jaquier Committed by GitHub
Browse files

Merge pull request #268 from AurelienJaquier/jinja-template

update jinja templates
parents 835ddb31 41da32b3
No related branches found
No related tags found
No related merge requests found
...@@ -184,7 +184,8 @@ proc distribute_distance(){local x localobj sl ...@@ -184,7 +184,8 @@ proc distribute_distance(){local x localobj sl
this.soma[0] distance(0, 0.5) this.soma[0] distance(0, 0.5)
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc) sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
forsec sl for(x, 0) { forsec sl for(x, 0) {
sprint(stmp, distfunc, secname(), x, distance(x)) // use distance(x) twice for the step distribution case, e.g. for calcium hotspot
sprint(stmp, distfunc, secname(), x, distance(x), distance(x))
execute(stmp) execute(stmp)
} }
} }
......
...@@ -138,16 +138,27 @@ func getThreshold() { return 0.0 } ...@@ -138,16 +138,27 @@ func getThreshold() { return 0.0 }
proc load_morphology(/* morphology_dir, morphology_name */) {localobj morph, import, sf, extension, commands, pyobj proc load_morphology(/* morphology_dir, morphology_name */) {localobj morph, import, sf, extension, commands, pyobj
strdef morph_path strdef morph_path
sprint(morph_path, "%s/%s", $s1, $s2) sf = new StringFunctions() sprint(morph_path, "%s/%s", $s1, $s2)
extension = new String() sscanf(morph_path, "%s", extension.s) sf = new StringFunctions()
extension = new String()
sscanf(morph_path, "%s", extension.s)
// TODO fix the `-3` here.
sf.right(extension.s, sf.len(extension.s)-3) sf.right(extension.s, sf.len(extension.s)-3)
if( strcmp(extension.s, ".asc") == 0 ) { if( strcmp(extension.s, "asc") == 0 ) {
morph = new Import3d_Neurolucida3() morph = new Import3d_Neurolucida3()
} else if( strcmp(extension.s, ".swc" ) == 0) { morph.quiet = 1
morph.input(morph_path)
import = new Import3d_GUI(morph, 0)
import.instantiate(this)
} else if( strcmp(extension.s, "swc" ) == 0) {
morph = new Import3d_SWC_read() morph = new Import3d_SWC_read()
morph.quiet = 1
morph.input(morph_path)
import = new Import3d_GUI(morph, 0)
import.instantiate(this)
} else if( strcmp(extension.s, ".h5") == 0 ) { } else if( strcmp(extension.s, ".h5") == 0 ) {
if(nrnpython ("from morphio_wrapper import MorphIOWrapper") == 1) { if(nrnpython ("from morphio_wrapper import MorphIOWrapper") == 1) {
pyobj = new PythonObject() pyobj = new PythonObject()
...@@ -181,7 +192,8 @@ proc distribute_distance(){local x localobj sl ...@@ -181,7 +192,8 @@ proc distribute_distance(){local x localobj sl
this.soma[0] distance(0, 0.5) this.soma[0] distance(0, 0.5)
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc) sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
forsec sl for(x, 0) { forsec sl for(x, 0) {
sprint(stmp, distfunc, secname(), x, distance(x)) // use distance(x) twice for the step distribution case, e.g. for calcium hotspot
sprint(stmp, distfunc, secname(), x, distance(x), distance(x))
execute(stmp) execute(stmp)
} }
} }
......
...@@ -41,6 +41,10 @@ begintemplate {{template_name}} ...@@ -41,6 +41,10 @@ begintemplate {{template_name}}
public all, somatic, apical, axonal, basal, myelinated, APC public all, somatic, apical, axonal, basal, myelinated, APC
objref all, somatic, apical, axonal, basal, myelinated, APC objref all, somatic, apical, axonal, basal, myelinated, APC
obfunc getCell(){
return this
}
proc init(/* args: morphology_dir, morphology_name */) { proc init(/* args: morphology_dir, morphology_name */) {
all = new SectionList() all = new SectionList()
apical = new SectionList() apical = new SectionList()
...@@ -112,7 +116,8 @@ proc distribute_distance(){local x localobj sl ...@@ -112,7 +116,8 @@ proc distribute_distance(){local x localobj sl
this.soma[0] distance(0, 0.5) this.soma[0] distance(0, 0.5)
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc) sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
forsec sl for(x, 0) { forsec sl for(x, 0) {
sprint(stmp, distfunc, secname(), x, distance(x)) // use distance(x) twice for the step distribution case, e.g. for calcium hotspot
sprint(stmp, distfunc, secname(), x, distance(x), distance(x))
execute(stmp) execute(stmp)
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment