bmtk.simulator.utils package

Submodules

bmtk.simulator.utils.simulation_inputs module

class bmtk.simulator.utils.simulation_inputs.SimInput(input_name, input_type, module, params)[source]

Bases: object

A helper class for parsing the “inputs” section of a SONATA config file. Separate the actual parameters needed to instantiate a module from the metadata parameters (eg, name, module, input_type)

Use the build() method to parse the json/dictionary of a section of input, then params to get a dictionary of the values used to instantiate:

input = SimInput.Build(
          'spikes_inputs',
          {'module': 'spikes', 'input_type': 'hdf5', input_file: 'my_spikes.h5', 'time_scale': 'ms'}
)

if input.module == 'spike':
    SpikesInput(**params)
    ...

Attributes:

  • name - str, name of module

  • input_type - str

  • module - str,

  • params - dictionary, all parameters (not including name, input_type, module)

Custom Modules:

Sometimes certain input types may require extra steps in processing, like auto-conversion of filling in missing parameters. In this case use the register module method:

class MyVClampInput(SimInput):
    def avail_module():
        return ['vclamp', 'voltage_clamp']

    def build():
        ....

SimInput.registerModule(MyVClampInput)

Then when SimInput.build() is called and the ‘module_name’==’vclamp’ (or ‘voltage_clamp’) it will pass the parsing to the MyVClampInput class.

classmethod build(input_name, params)[source]

Creates a SimInput object with parsed out parameters

Parameters:
  • input_name – name of specific input

  • params – dictionary of input parameters

Returns:

SimInput object, or subclass that matches the specified ‘module’ value

property node_set
classmethod register_module(subclass)[source]
Parameters:

subclass

registry = {}
bmtk.simulator.utils.simulation_inputs.from_config(cfg)[source]

Takes in a bmtk.utils.Config instance and will automatically parse each “input” in the config sections, returning a list of SimInput objects. If an input has “enabled” = False then it will automatically be excluded.

Parameters:

cfg – A SONATAConfig object

Returns:

A list of SimInput modules corresponding to the parsed inputs of a config.

bmtk.simulator.utils.simulation_reports module

class bmtk.simulator.utils.simulation_reports.ClampReport(report_name, module, params)[source]

Bases: SimReport

static avail_modules()[source]
property node_set
class bmtk.simulator.utils.simulation_reports.ECPReport(report_name, module, params)[source]

Bases: SimReport

static avail_modules()[source]
classmethod build(name, params)[source]

Factory method to get the module subclass, using the params (particularlly the ‘module’ value, which is required). If there is no registered subclass a generic SimReport object will be returned

Parameters:
  • report_name – name of report

  • params – parameters of report

Returns:

A SimReport (or subclass) object with report parameters parsed out.

class bmtk.simulator.utils.simulation_reports.MembraneReport(report_name, module, params)[source]

Bases: SimReport, object

add_variables(var_name, transform)[source]
static avail_modules()[source]
classmethod build(name, params)[source]

Factory method to get the module subclass, using the params (particularlly the ‘module’ value, which is required). If there is no registered subclass a generic SimReport object will be returned

Parameters:
  • report_name – name of report

  • params – parameters of report

Returns:

A SimReport (or subclass) object with report parameters parsed out.

can_combine(other)[source]
class bmtk.simulator.utils.simulation_reports.MultimeterReport(report_name, module, params)[source]

Bases: MembraneReport

static avail_modules()[source]
class bmtk.simulator.utils.simulation_reports.NetconReport(report_name, module, params)[source]

Bases: MembraneReport

static avail_modules()[source]
class bmtk.simulator.utils.simulation_reports.SEClampReport(report_name, module, params)[source]

Bases: SimReport

static avail_modules()[source]
class bmtk.simulator.utils.simulation_reports.SaveSynapses(report_name, module, params)[source]

Bases: SimReport

static avail_modules()[source]
class bmtk.simulator.utils.simulation_reports.SimReport(name, module, params)[source]

Bases: object

Used for parsing reports section from a SONATA configuration file. It will take care of implicit and default values.

Use the build() method to convert a “reports” section dictionary to a SimReport object. The SimReport object has properties that can be used to instantiate a simualtion report, particular properties module and params:

report = SimReport.build(
    report_name='my_report',
    params = {'module': 'my_mod', ...})
...
MyReport(**report.params)
static avail_modules()[source]
classmethod build(report_name, params)[source]

Factory method to get the module subclass, using the params (particularlly the ‘module’ value, which is required). If there is no registered subclass a generic SimReport object will be returned

Parameters:
  • report_name – name of report

  • params – parameters of report

Returns:

A SimReport (or subclass) object with report parameters parsed out.

default_dir = '.'
property node_set
classmethod register_module(subclass)[source]
registry = {'SEClamp': <class 'bmtk.simulator.utils.simulation_reports.SEClampReport'>, 'SaveSynapses': <class 'bmtk.simulator.utils.simulation_reports.SaveSynapses'>, 'clamp_report': <class 'bmtk.simulator.utils.simulation_reports.ClampReport'>, 'extracellular': <class 'bmtk.simulator.utils.simulation_reports.ECPReport'>, 'membrane_report': <class 'bmtk.simulator.utils.simulation_reports.MembraneReport'>, 'multimeter': <class 'bmtk.simulator.utils.simulation_reports.MultimeterReport'>, 'multimeter_report': <class 'bmtk.simulator.utils.simulation_reports.MultimeterReport'>, 'netcon_report': <class 'bmtk.simulator.utils.simulation_reports.NetconReport'>, 'spikes_report': <class 'bmtk.simulator.utils.simulation_reports.SpikesReport'>}
class bmtk.simulator.utils.simulation_reports.SpikesReport(report_name, module, params)[source]

Bases: SimReport

static avail_modules()[source]
classmethod build(name, params)[source]

Factory method to get the module subclass, using the params (particularlly the ‘module’ value, which is required). If there is no registered subclass a generic SimReport object will be returned

Parameters:
  • report_name – name of report

  • params – parameters of report

Returns:

A SimReport (or subclass) object with report parameters parsed out.

classmethod from_output_dict(output_dict)[source]
bmtk.simulator.utils.simulation_reports.from_config(cfg)[source]

Module contents