Example #1
0
 def inject_input(self):
     # Injects current in consecutive subgroups, where I_offset have the same value
     # on successive intervals
     I_offset = self.inputs_offset
     k = -1
     for i in hstack((nonzero(diff(I_offset))[0], len(I_offset) - 1)):
         I_offset_subgroup_value = I_offset[i]
         I_offset_subgroup_length = i - k
         sliced_subgroup = self.group.subgroup(I_offset_subgroup_length)
         input_sliced_values = self.inputs_inline[I_offset_subgroup_value:I_offset_subgroup_value + self.total_steps]
         sliced_subgroup.set_var_by_array(self.input_var, TimedArray(input_sliced_values, clock=self.group.clock))
         k = i