bmtk.utils.io package

Submodules

bmtk.utils.io.cell_vars module

class bmtk.utils.io.cell_vars.CellVarRecorder(file_name, tmp_dir, variables, buffer_data=True, mpi_rank=0, mpi_size=1, **kwargs)[source]

Bases: object

Used to save cell membrane variables (V, Ca2+, etc) to the described hdf5 format.

For parallel simulations this class will write to a seperate tmp file on each rank, then use the merge method to combine the results. This is less efficent, but doesn’t require the user to install mpi4py and build h5py in parallel mode. For better performance use the CellVarRecorderParallel class instead.

class DataTable(var_name)[source]

Bases: object

A small struct to keep track of different */data (and buffer) tables

add_cell(gid, sec_list, seg_list, **map_attrs)[source]
close()[source]
property dt
flush()[source]

Move data from memory to dataset

initialize(n_steps, buffer_size=0)[source]
property is_initialized
merge()[source]
record_cell(gid, var_name, seg_vals, tstep)[source]

Record cell parameters.

Parameters
  • gid – gid of cell.

  • var_name – name of variable being recorded.

  • seg_vals – list of all segment values

  • tstep – time step

record_cell_block(gid, var_name, seg_vals)[source]

Save cell parameters one block at a time

Parameters
  • gid – gid of cell.

  • var_name – name of variable being recorded.

  • seg_vals – A vector/matrix of values being recorded

property tstart
property tstop
class bmtk.utils.io.cell_vars.CellVarRecorderParallel(file_name, tmp_dir, variables, buffer_data=True, **kwargs)[source]

Bases: bmtk.utils.io.cell_vars.CellVarRecorder

Unlike the parent, this take advantage of parallel h5py to writting to the results file across different ranks.

merge()[source]

bmtk.utils.io.firing_rates module

class bmtk.utils.io.firing_rates.RatesInput(params)[source]

Bases: object

get_rate(gid)[source]
property populations
class bmtk.utils.io.firing_rates.RatesWriter(file_name)[source]

Bases: object

add_rates(gid, times, rates)[source]
to_csv(file_name)[source]
to_h5(file_name)[source]

bmtk.utils.io.ioutils module

class bmtk.utils.io.ioutils.BMTKWorldComm[source]

Bases: object

property MPI_rank
property MPI_size
barrier()[source]
property comm
bmtk.utils.io.ioutils.set_world_comm(comm)[source]

bmtk.utils.io.spike_trains module

class bmtk.utils.io.spike_trains.DFIndexedGIDs(spikes_input_h5)[source]

Bases: bmtk.utils.io.spike_trains.SONATAIndexer

get_spikes(gid)[source]
class bmtk.utils.io.spike_trains.DictIndexedGIDs(spikes_input_h5)[source]

Bases: bmtk.utils.io.spike_trains.SONATAIndexer

get_spikes(gid)[source]
class bmtk.utils.io.spike_trains.HDF5IndexedGIDs(spikes_input_h5)[source]

Bases: bmtk.utils.io.spike_trains.SONATAIndexer

class bmtk.utils.io.spike_trains.PoissonSpikesGenerator(gids, firing_rate, tstart=0.0, tstop=1000.0)[source]

Bases: object

to_hdf5(file_name, sort_order='gid')[source]
class bmtk.utils.io.spike_trains.SONATAIndexer[source]

Bases: object

get_spikes(gid)[source]
class bmtk.utils.io.spike_trains.SpikeTrainWriter(tmp_dir, mpi_rank=0, mpi_size=1)[source]

Bases: object

class TmpFileMetadata(file_name, sort_order=None)[source]

Bases: object

add_spike(time, gid)[source]
add_spikes(times, gid)[source]
add_spikes_file(file_name, sort_order=None)[source]
close()[source]
close_tmp_file()[source]
flush()[source]
to_csv(csv_file, sort_order=None, gid_map=None)[source]
to_hdf5(hdf5_file, sort_order=None, gid_map=None)[source]
to_nwb(nwb_file)[source]
class bmtk.utils.io.spike_trains.SpikesInput[source]

Bases: object

get_spikes(gid)[source]
static load(name, module, input_type, params)[source]
class bmtk.utils.io.spike_trains.SpikesInputCSV(name, module, input_type, params)[source]

Bases: bmtk.utils.io.spike_trains.SpikesInput

get_spikes(gid)[source]
class bmtk.utils.io.spike_trains.SpikesInputH5(name, module, input_type, params)[source]

Bases: bmtk.utils.io.spike_trains.SpikesInput

get_spikes(gid)[source]
property gids
property timestamps
class bmtk.utils.io.spike_trains.SpikesInputNWBv1(name, module, input_type, params)[source]

Bases: bmtk.utils.io.spike_trains.SpikesInput

get_spikes(gid)[source]
class bmtk.utils.io.spike_trains.UnindexedGIDs(spikes_input_h5)[source]

Bases: bmtk.utils.io.spike_trains.SONATAIndexer

Module contents

bmtk.utils.io.log_warning(message)[source]