brainpy.inputs.section_input(values, durations, dt=None, return_length=False)[source]#

Format an input current with different sections.

For example:

If you want to get an input where the size is 0 bwteen 0-100 ms, and the size is 1. between 100-200 ms.

>>> section_input(values=[0, 1],
>>>               durations=[100, 100])
  • values (list, np.ndarray) – The current values for each period duration.

  • durations (list, np.ndarray) – The duration for each period.

  • dt (float) – Default is None.

  • return_length (bool) – Return the final duration length.

Return type: