Changeset 31631 in project


Ignore:
Timestamp:
10/09/14 05:42:32 (5 years ago)
Author:
Ivan Raikov
Message:

nemo: updated templates for compatibility with jinja

Location:
release/4/nemo/trunk
Files:
1 added
11 edited
1 moved

Legend:

Unmodified
Added
Removed
  • release/4/nemo/trunk/templates/NEST-accessors_modifiers.tmpl

    r31619 r31631  
    4848
    4949{% for stateDef in stateDefs %}
    50    def<double_t>(d, "{{stateDef.name}}", y_[{{attr(stateIndexMap,stateDef.name)}}]);
     50   def<double_t>(d, "{{stateDef.name}}", y_[{{stateIndexMap | attr(stateDef.name)}}]);
    5151
    5252{% endfor %}   
    5353   
    54 {% if haskey(stateIndexMap,"v") %}
    55    def<double_t>(d, names::V_m, y_[{{attr(stateIndexMap,"v")}}]);
     54{% if ("v" in stateIndexMap) %}
     55   def<double_t>(d, names::V_m, y_[{{stateIndexMap | attr("v")}}]);
    5656
    5757{% endif %}   
     
    6363
    6464{% for stateDef in stateDefs %}
    65    updateValue<double_t>(d, "{{stateDef.name}}", y_[{{attr(stateIndexMap,stateDef.name)}}]);
     65   updateValue<double_t>(d, "{{stateDef.name}}", y_[{{stateIndexMap | attr(stateDef.name)}}]);
    6666
    6767{% endfor %}   
    6868
    69 {% if haskey(stateIndexMap,"v") %}
    70    updateValue<double_t>(d, names::V_m, y_[{{attr(stateIndexMap,"v")}}]);
     69{% if ("v" in stateIndexMap) %}
     70   updateValue<double_t>(d, names::V_m, y_[{{stateIndexMap | attr("v")}}]);
    7171
    7272{% endif %}   
  • release/4/nemo/trunk/templates/NEST-cvode-event.tmpl

    r31594 r31631  
    1919  state = &(node.S_);
    2020
    21 {% if (haskey(stateIndexMap,"v") and ("V_t" in defaultDefs)) %}
    22   v = Ith (y, {{attr(stateIndexMap,"v")}});
     21{% if (("v" in stateIndexMap) and ("V_t" in defaultDefs)) %}
     22  v = Ith (y, {{stateIndexMap | attr("v")}});
    2323  vt = params->V_t;
    2424  g[0] = v - vt;
  • release/4/nemo/trunk/templates/NEST-emit-spike.tmpl

    r31618 r31631  
    1818            S_.r_--;
    1919         else
    20             if (S_.y_[{{attr(stateIndexMap,"v")}}] >= P_.V_t && V_.U_old_ > S_.y_[{{attr(stateIndexMap,"v")}}])
     20            if (S_.y_[{{stateIndexMap | attr("v")}}] >= P_.V_t && V_.U_old_ > S_.y_[{{stateIndexMap | attr("v")}}])
    2121              {
    2222                S_.r_ = V_.RefractoryCounts_;
  • release/4/nemo/trunk/templates/NEST-function.tmpl

    r31618 r31631  
    1717  double {{functionDef.returnVar}};
    1818
    19 {% if (!(functionDef.localVars == [])) %}
     19{% if (not (functionDef.localVars == [])) %}
    2020  double {{functionDef.localVars | join(", ")}};
    2121{% endif %}
    22 {% if (!(functionDef.consts == [])) %}
     22{% if (not (functionDef.consts == [])) %}
    2323  double {{functionDef.consts | join(", ")}};
    2424  const {{modelName}}::Parameters_ & p = *(reinterpret_cast< const {{modelName}}::Parameters_ *>(params));
  • release/4/nemo/trunk/templates/NEST-header.tmpl

    r31622 r31631  
    186186
    187187      enum StateVecElems {
    188 {% for k in keys(stateIndexMap) %}
    189       {{k | upper}} = {{attr(stateIndexMap,k)}}{% if (not (loop.last)) %},{% endif %}
     188{% for k in stateDefs %}
     189      {{k.name | upper}} = {{stateIndexMap[k.name]}}{% if (not (loop.last)) %},{% endif %}
    190190
    191191{% endfor %}
  • release/4/nemo/trunk/templates/NEST-ida-event.tmpl

    r31587 r31631  
    1919  state = &(node.S_);
    2020
    21 {% if (haskey(stateIndexMap,"v") and ("V_t" in defaultDefs)) %}     
    22   v = Ith (y, {{attr(stateIndexMap,"v")}});
     21{% if (("v" in stateIndexMap) and ("V_t" in defaultDefs)) %}     
     22  v = Ith (y, {{stateIndexMap | attr("v")}});
    2323  vt = params->V_t;
    2424  g[0] = v - vt;
  • release/4/nemo/trunk/templates/NEST-init.tmpl

    r31618 r31631  
    4646   
    4747{% for name in rateEqStates %}
    48 {% if (haskey(steadyStateIndexMap,name)) %}
    49    y_[{{attr(stateIndexMap,name)}}] = Ith({{SSvector}}, {{attr(steadyStateIndexMap,name)}});
     48{% if (name in steadyStateIndexMap) %}
     49   y_[{{stateIndexMap | attr(name)}}] = Ith({{SSvector}}, {{steadyStateIndexMap | attr(name)}});
    5050
    5151{% else %}
    52    y_[{{attr(stateIndexMap,name)}}] = {{name}};
     52   y_[{{stateIndexMap | attr(name)}}] = {{name}};
    5353
    5454{% endif %}
     
    6565             
    6666{% for name in init.rateEqStates %}
    67 {% if (haskey(steadyStateIndexMap,name)) %}
    68    y_[{{attr(stateIndexMap,name)}}] = gsl_vector_get({{SSvector}}, {{attr(steadyStateIndexMap,name)}});
     67{% if (name in steadyStateIndexMap) %}
     68   y_[{{stateIndexMap | attr(name)}}] = gsl_vector_get({{SSvector}}, {{steadyStateIndexMap | attr(name)}});
    6969
    7070{% else %}
    71    y_[{{attr(stateIndexMap,name)}}] = {{name}};
     71   y_[{{stateIndexMap | attr(name)}}] = {{name}};
    7272
    7373{% endif %}
     
    8686{% endfor %}
    8787
    88 {% if (haskey(steadyStateIndexMap,"v")) %}
    89    y_[{{attr(steadyStateIndexMap,"v")}}] =  v;
     88{% if ("v" in steadyStateIndexMap) %}
     89   y_[{{steadyStateIndexMap | attr("v")}}] =  v;
    9090
    9191{% endif %}
  • release/4/nemo/trunk/templates/NEST-nodes.tmpl

    r31618 r31631  
    391391{
    392392    B_.logger_.init(); 
    393     {% if haskey(stateIndexMap,"v") %}V_.U_old_ = S_.y_[{{attr(stateIndexMap,"v")}}];{% endif %}
     393    {% if ("v" in stateIndexMap) %}V_.U_old_ = S_.y_[{{stateIndexMap | attr("v")}}];{% endif %}
    394394{% if ("t_ref" in defaultDefs) %}
    395395    V_.RefractoryCounts_ = Time(Time::ms(P_.t_ref)).get_steps();
  • release/4/nemo/trunk/templates/NEST-recordables.tmpl

    r31618 r31631  
    1010{% endfor %}
    1111
    12 {% if haskey(stateIndexMap,"v") %}
     12{% if ("v" in stateIndexMap) %}
    1313   insert_(names::V_m, &{{modelName}}::get_y_elem_<{{modelName}}::State_::V>);
    1414
  • release/4/nemo/trunk/templates/NEST-steadystate.tmpl

    r31618 r31631  
    6565
    6666{% for x in steadystate.SSsetStateDefsLbs %}
    67 {% if (!(x.lbs == [])) %}
     67{% if (not (x.lbs == [])) %}
    6868   double {{x.lbs | join(", ")}};
    6969
  • release/4/nemo/trunk/templates/NEST-update.tmpl

    r31618 r31631  
    6767{% elif (ODEmethod == "gsl") %}
    6868
    69         V_.U_old_ = S_.y_[{{attr(stateIndexMap,"v")}}];
     69        V_.U_old_ = S_.y_[{{stateIndexMap | attr("v")}}];
    7070
    7171        while (tt < h)
Note: See TracChangeset for help on using the changeset viewer.