Brian Parameters and Monitors

BrianParameter

class pypet.brian.parameter.BrianParameter(full_name, data=None, comment='', storage_mode='FLOAT')

A Parameter class that supports BRIAN Quantities.

There are two storage modes:

  • FLOAT_MODE: (‘FLOAT’)

    The value is stored as a float and the unit as a sting.

    i.e. 12 mV is stored as 12.0 and ‘1.0 * mV’

  • STRING_MODE: (‘STRING’)

    The value and unit are stored combined together as a string.

    i.e. 12 mV is stored as ‘12.0 * mV’

Supports data for the standard Parameter, too.

f_supports(data)

Simply checks if data is supported

v_storage_mode

There are two storage modes:

  • FLOAT_MODE: (‘FLOAT’)

    The value is stored as a float and the unit as a sting.

    i.e. 12 mV is stored as 12.0 and ‘1.0 * mV’

  • STRING_MODE: (‘STRING’)

    The value and unit are stored combined together as a string.

    i.e. 12 mV is stored as ‘12.0 * mV’

BrianMonitorResult

class pypet.brian.parameter.BrianMonitorResult(full_name, *args, **kwargs)

A Result class that supports brian monitors.

Monitor attributes are extracted and added as results with the attribute names. Note the original monitors are NOT stored, only their attribute/property values are kept.

Add monitor on __init__ via monitor= or via f_set(monitor=brian_monitor)

Following monitors are supported:

  • SpikeCounter
  • VanRossumMetric
  • PopulationSpikeCounter
  • StateSpikeMonitor
  • PopulationRateMonitor
  • ISIHistogramMonitor:
  • SpikeMonitor
  • MultiStateMonitor
  • StateMonitor

Example:

>>> brian_result = BrianMonitorResult('example.brian.mymonitor', monitor=SpikeMonitor(...), comment='Im a SpikeMonitor Example!')
>>> brian_result.nspikes
1337

There are two storage modes in case you use the SpikeMonitor and StateSpikeMonitor:

  • TABLE_MODE: (‘TABLE’)

    Default, information is stored into a single table where the first column is the neuron index, second column is the spike time following columns contain variable values (in case of the StateSpikeMonitor) This is a very compact storage form.

  • ARRAY_MODE: (‘ARRAY’)

    For each neuron there will be a new hdf5 array, i.e. if you have many neurons your result node will have many entries. Note that this mode does sort everything according to the neurons but reading and writing of data might take muuuuuch longer compared to the other mode.

f_set_single(name, item)

To add a monitor use f_set_single(‘monitor’, brian_monitor).

Otherwise f_set_single works similar to f_set_single().

v_storage_mode

The storage mode for SpikeMonitor and StateSpikeMonitor

There are two storage modes:

  • TABLE_MODE: (‘TABLE’)

    Default, information is stored into a single table where the first column is the neuron index, second column is the spike time following columns contain variable values (in case of the StateSpikeMonitor) This is a very compact storage form.

  • ARRAY_MODE: (‘ARRAY’)

    For each neuron there will be a new hdf5 array, i.e. if you have many neurons your result node will have many entries. Note that this mode does sort everything according to the neurons but reading and writing of data might take muuuuuch longer compared to the other mode.