Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update jinja templates #268

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bluepymm/templates/cell_template_neurodamus.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ proc distribute_distance(){local x localobj sl
this.soma[0] distance(0, 0.5)
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
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)
}
}
Expand Down
24 changes: 18 additions & 6 deletions bluepymm/templates/cell_template_neurodamus_sbo.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,27 @@ func getThreshold() { return 0.0 }

proc load_morphology(/* morphology_dir, morphology_name */) {localobj morph, import, sf, extension, commands, pyobj
strdef morph_path
sprint(morph_path, "%s/%s", $s1, $s2) sf = new StringFunctions()
extension = new String() sscanf(morph_path, "%s", extension.s)
sprint(morph_path, "%s/%s", $s1, $s2)
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)

if( strcmp(extension.s, ".asc") == 0 ) {
if( strcmp(extension.s, "asc") == 0 ) {
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.quiet = 1
morph.input(morph_path)

import = new Import3d_GUI(morph, 0)
import.instantiate(this)
} else if( strcmp(extension.s, ".h5") == 0 ) {
if(nrnpython ("from morphio_wrapper import MorphIOWrapper") == 1) {
pyobj = new PythonObject()
Expand Down Expand Up @@ -181,7 +192,8 @@ proc distribute_distance(){local x localobj sl
this.soma[0] distance(0, 0.5)
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
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)
}
}
Expand Down
7 changes: 6 additions & 1 deletion bluepymm/templates/cell_template_neuron.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ begintemplate {{template_name}}
public 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 */) {
all = new SectionList()
apical = new SectionList()
Expand Down Expand Up @@ -112,7 +116,8 @@ proc distribute_distance(){local x localobj sl
this.soma[0] distance(0, 0.5)
sprint(distfunc, "%%s %s(%%f) = %s", mech, distfunc)
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)
}
}
Expand Down
Loading