ALLEN INSTITUTE

# bmtk.utils package

## Subpackages

- bmtk.utils.cell_types_db package
  - Module contents
    - `download_ephys_data()`
    - `download_model()`
    - `test_fn()`
- bmtk.utils.compile_mechanisms package
  - Submodules
  - bmtk.utils.compile_mechanisms.compile_mechanisms module
    - `compile_mechanisms()`
    - `copy_modfiles()`
  - Module contents
- bmtk.utils.create_environment package
  - Submodules
  - bmtk.utils.create_environment.create_environment module
    - `create_environment()`
  - bmtk.utils.create_environment.env_builder module
    - `BioNetEnvBuilder`
      - `BioNetEnvBuilder.bmtk_simulator`
      - `BioNetEnvBuilder.compile_mechanisms()`
      - `BioNetEnvBuilder.examples_dir`
      - `BioNetEnvBuilder.target_simulator`
    - `EnvBuilder`
      - `EnvBuilder.base_dir`
      - `EnvBuilder.bmtk_simulator`
      - `EnvBuilder.build()`
      - `EnvBuilder.compile_mechanisms()`
      - `EnvBuilder.components_dir`
      - `EnvBuilder.examples_dir`
      - `EnvBuilder.network_dir`
      - `EnvBuilder.output_dir`
      - `EnvBuilder.scripts_root`
      - `EnvBuilder.target_simulator`
    - `FilterNetEnvBuilder`
      - `FilterNetEnvBuilder.bmtk_simulator`
      - `FilterNetEnvBuilder.examples_dir`
      - `FilterNetEnvBuilder.target_simulator`
    - `PointNetEnvBuilder`
      - `PointNetEnvBuilder.bmtk_simulator`
      - `PointNetEnvBuilder.examples_dir`
      - `PointNetEnvBuilder.target_simulator`
    - `PopNetEnvBuilder`
      - `PopNetEnvBuilder.bmtk_simulator`
      - `PopNetEnvBuilder.examples_dir`
      - `PopNetEnvBuilder.target_simulator`
  - Module contents
- bmtk.utils.io package
  - Submodules
  - bmtk.utils.io.cell_vars module
    - `CellVarRecorder`
      - `CellVarRecorder.DataTable`
      - `CellVarRecorder.add_cell()`
      - `CellVarRecorder.close()`
      - `CellVarRecorder.dt`
      - `CellVarRecorder.flush()`
      - `CellVarRecorder.initialize()`
      - `CellVarRecorder.is_initialized`
      - `CellVarRecorder.merge()`
      - `CellVarRecorder.record_cell()`
      - `CellVarRecorder.record_cell_block()`
      - `CellVarRecorder.tstart`
      - `CellVarRecorder.tstop`
    - `CellVarRecorderParallel`
      - `CellVarRecorderParallel.merge()`
  - bmtk.utils.io.firing_rates module
    - `RatesInput`
      - `RatesInput.get_rate()`
      - `RatesInput.populations`
    - `RatesWriter`
      - `RatesWriter.add_rates()`
      - `RatesWriter.to_csv()`
      - `RatesWriter.to_h5()`
  - bmtk.utils.io.ioutils module
    - `BMTKWorldComm`
      - `BMTKWorldComm.MPI_rank`
      - `BMTKWorldComm.MPI_size`
      - `BMTKWorldComm.barrier()`
      - `BMTKWorldComm.comm`
    - `set_world_comm()`
  - bmtk.utils.io.spike_trains module
    - `DFIndexedGIDs`
      - `DFIndexedGIDs.get_spikes()`
    - `DictIndexedGIDs`
      - `DictIndexedGIDs.get_spikes()`
    - `HDF5IndexedGIDs`
    - `PoissonSpikesGenerator`
      - `PoissonSpikesGenerator.to_hdf5()`
    - `SONATAIndexer`
      - `SONATAIndexer.get_spikes()`
    - `SpikeTrainWriter`
      - `SpikeTrainWriter.TmpFileMetadata`
      - `SpikeTrainWriter.add_spike()`
      - `SpikeTrainWriter.add_spikes()`
      - `SpikeTrainWriter.add_spikes_file()`
      - `SpikeTrainWriter.close()`
      - `SpikeTrainWriter.close_tmp_file()`
      - `SpikeTrainWriter.flush()`
      - `SpikeTrainWriter.to_csv()`
      - `SpikeTrainWriter.to_hdf5()`
      - `SpikeTrainWriter.to_nwb()`
    - `SpikesInput`
      - `SpikesInput.get_spikes()`
      - `SpikesInput.load()`
    - `SpikesInputCSV`
      - `SpikesInputCSV.get_spikes()`
    - `SpikesInputH5`
      - `SpikesInputH5.get_spikes()`
      - `SpikesInputH5.gids`
      - `SpikesInputH5.timestamps`
    - `SpikesInputNWBv1`
      - `SpikesInputNWBv1.get_spikes()`
    - `UnindexedGIDs`
  - Module contents
    - `log_warning()`
- bmtk.utils.reports package
  - Subpackages
    - bmtk.utils.reports.compartment package
      - Submodules
      - bmtk.utils.reports.compartment.compartment_reader module
      - bmtk.utils.reports.compartment.compartment_report module
      - bmtk.utils.reports.compartment.compartment_writer module
      - bmtk.utils.reports.compartment.core module
      - bmtk.utils.reports.compartment.plotting module
      - Module contents
    - bmtk.utils.reports.spike_trains package
      - Submodules
      - bmtk.utils.reports.spike_trains.core module
      - bmtk.utils.reports.spike_trains.plotting module
      - bmtk.utils.reports.spike_trains.spike_train_buffer module
      - bmtk.utils.reports.spike_trains.spike_train_readers module
      - bmtk.utils.reports.spike_trains.spike_trains module
      - bmtk.utils.reports.spike_trains.spike_trains_api module
      - bmtk.utils.reports.spike_trains.spikes_file_writers module
      - bmtk.utils.reports.spike_trains.stats module
      - Module contents
  - Submodules
  - bmtk.utils.reports.current_writer module
    - `CurrentWriterv01`
      - `CurrentWriterv01.DataTable`
      - `CurrentWriterv01.close()`
      - `CurrentWriterv01.dt()`
      - `CurrentWriterv01.flush()`
      - `CurrentWriterv01.initialize()`
      - `CurrentWriterv01.merge()`
      - `CurrentWriterv01.n_steps()`
      - `CurrentWriterv01.record_clamps()`
      - `CurrentWriterv01.set_dt()`
      - `CurrentWriterv01.set_tstart()`
      - `CurrentWriterv01.set_tstop()`
      - `CurrentWriterv01.set_units()`
      - `CurrentWriterv01.tstart()`
      - `CurrentWriterv01.tstop()`
      - `CurrentWriterv01.units()`
  - Module contents
- bmtk.utils.sonata package
  - Subpackages
    - bmtk.utils.sonata.config package
      - Submodules
      - bmtk.utils.sonata.config.sonata_config module
      - Module contents
  - Submodules
  - bmtk.utils.sonata.column_property module
    - `ColumnProperty`
      - `ColumnProperty.attributes`
      - `ColumnProperty.dimension`
      - `ColumnProperty.dtype`
      - `ColumnProperty.from_csv()`
      - `ColumnProperty.from_h5()`
      - `ColumnProperty.name`
      - `ColumnProperty.nrows`
  - bmtk.utils.sonata.edge module
    - `Edge`
      - `Edge.dynamics_params`
      - `Edge.edge_type_id`
      - `Edge.group_id`
      - `Edge.source_node_id`
      - `Edge.source_population`
      - `Edge.target_node_id`
      - `Edge.target_population`
    - `EdgeSet`
      - `EdgeSet.next()`
  - bmtk.utils.sonata.edge_stats module
    - `chisquare()`
    - `edge_props_distribution()`
    - `edge_stats_table()`
    - `kolmogorov_smirnov()`
    - `nconnections_distributions()`
    - `nsyns_distribution()`
    - `pearson_r()`
    - `plot_correlation()`
    - `plot_distribution()`
    - `to_edges_dataframe()`
    - `to_nodes_dataframe()`
  - bmtk.utils.sonata.file module
    - `File`
      - `File.edges`
      - `File.has_edges`
      - `File.has_nodes`
      - `File.nodes`
      - `File.version`
  - bmtk.utils.sonata.file_root module
    - `EdgesRoot`
      - `EdgesRoot.edge_types_table`
      - `EdgesRoot.get_populations()`
    - `FileRoot`
      - `FileRoot.check_format()`
      - `FileRoot.get_population()`
      - `FileRoot.population_names`
      - `FileRoot.populations`
      - `FileRoot.root_name`
      - `FileRoot.types_table`
    - `NodesRoot`
      - `NodesRoot.generate_gids()`
      - `NodesRoot.has_gids`
      - `NodesRoot.node_types_table`
      - `NodesRoot.set_gid_table()`
  - bmtk.utils.sonata.group module
    - `EdgeGroup`
      - `EdgeGroup.build_indicies()`
      - `EdgeGroup.edge_type_ids`
      - `EdgeGroup.filter()`
      - `EdgeGroup.get_values()`
      - `EdgeGroup.next()`
      - `EdgeGroup.src_node_ids`
      - `EdgeGroup.to_dataframe()`
      - `EdgeGroup.trg_node_ids`
    - `Group`
      - `Group.all_columns`
      - `Group.build_indicies()`
      - `Group.check_format()`
      - `Group.column()`
      - `Group.columns`
      - `Group.get_dataset()`
      - `Group.get_values()`
      - `Group.group_columns`
      - `Group.group_id`
      - `Group.has_dynamics_params`
      - `Group.has_gids`
      - `Group.parent`
      - `Group.to_dataframe()`
    - `NodeGroup`
      - `NodeGroup.build_indicies()`
      - `NodeGroup.filter()`
      - `NodeGroup.get_values()`
      - `NodeGroup.gids`
      - `NodeGroup.node_ids`
      - `NodeGroup.node_type_ids`
      - `NodeGroup.to_dataframe()`
  - bmtk.utils.sonata.node module
    - `Node`
      - `Node.dynamics_params`
      - `Node.gid`
      - `Node.group_id`
      - `Node.group_props`
      - `Node.node_id`
      - `Node.node_type_id`
      - `Node.node_type_properties`
      - `Node.population_name`
    - `NodeSet`
      - `NodeSet.get_properties()`
      - `NodeSet.gids`
      - `NodeSet.next()`
      - `NodeSet.node_ids`
      - `NodeSet.node_type_ids`
  - bmtk.utils.sonata.population module
    - `EdgePopulation`
      - `EdgePopulation.build_indicies()`
      - `EdgePopulation.edge_types_table`
      - `EdgePopulation.filter()`
      - `EdgePopulation.get_row()`
      - `EdgePopulation.get_source()`
      - `EdgePopulation.get_source_population()`
      - `EdgePopulation.get_sources()`
      - `EdgePopulation.get_target()`
      - `EdgePopulation.get_target_population()`
      - `EdgePopulation.get_targets()`
      - `EdgePopulation.group_id_column`
      - `EdgePopulation.group_index_column`
      - `EdgePopulation.group_indicies()`
      - `EdgePopulation.next()`
      - `EdgePopulation.source_population`
      - `EdgePopulation.target_population`
      - `EdgePopulation.to_dataframe()`
      - `EdgePopulation.type_ids_column`
    - `NodePopulation`
      - `NodePopulation.add_gids()`
      - `NodePopulation.filter()`
      - `NodePopulation.get_gid()`
      - `NodePopulation.get_node_id()`
      - `NodePopulation.get_row()`
      - `NodePopulation.get_rows()`
      - `NodePopulation.gids`
      - `NodePopulation.group_id_column`
      - `NodePopulation.group_index_column`
      - `NodePopulation.has_gids`
      - `NodePopulation.igids()`
      - `NodePopulation.index_column_name`
      - `NodePopulation.inode_ids()`
      - `NodePopulation.inode_type_ids()`
      - `NodePopulation.next()`
      - `NodePopulation.node_ids`
      - `NodePopulation.node_types_table`
      - `NodePopulation.to_dataframe()`
      - `NodePopulation.type_ids_column`
    - `Population`
      - `Population.get_group()`
      - `Population.group_id_column`
      - `Population.group_id_ds`
      - `Population.group_ids`
      - `Population.group_index_column`
      - `Population.group_index_ds`
      - `Population.group_indicies()`
      - `Population.groups`
      - `Population.igroup_ids()`
      - `Population.igroup_indicies()`
      - `Population.name`
      - `Population.to_dataframe()`
      - `Population.type_ids`
      - `Population.type_ids_column`
      - `Population.types_table`
  - bmtk.utils.sonata.types_table module
    - `EdgeTypesTable`
      - `EdgeTypesTable.edge_type_ids`
      - `EdgeTypesTable.index_column_name`
    - `NodeTypesTable`
      - `NodeTypesTable.index_column_name`
      - `NodeTypesTable.node_type_ids`
    - `TypesTable`
      - `TypesTable.add_table()`
      - `TypesTable.column()`
      - `TypesTable.columns`
      - `TypesTable.find()`
      - `TypesTable.index_column_name`
      - `TypesTable.next()`
      - `TypesTable.to_dataframe()`
      - `TypesTable.type_ids`
    - `remove_nans()`
  - bmtk.utils.sonata.utils module
    - `add_hdf5_magic()`
    - `add_hdf5_version()`
    - `check_magic()`
    - `get_attribute_h5()`
    - `get_node_ids()`
    - `get_version()`
    - `listify()`
    - `load_csv()`
    - `load_h5()`
  - Module contents

## Submodules

## bmtk.utils.hdf5_helper module

bmtk.utils.hdf5_helper.get_attribute_h5(h5obj, attribut_name, default=None)

## bmtk.utils.lazy_property module

bmtk.utils.lazy_property.lazy_property(fn)

## bmtk.utils.sim_setup module

class bmtk.utils.sim_setup.BioNetEnvBuilder(base_dir='.', network_dir=None, components_dir=None, output_dir=None, node_sets_file=None)

  Bases: `EnvBuilder`

  property bmtk_simulator
  compile_mechanisms()
  property examples_dir
  property target_simulator

class bmtk.utils.sim_setup.EnvBuilder(base_dir='.', network_dir=None, components_dir=None, output_dir=None, node_sets_file=None)

  Bases: `object`

  property base_dir
  property bmtk_simulator
  build(include_examples=False, use_relative_paths=True, report_vars=[], report_nodes=None, clamp_reports=[], current_clamp=None, file_current_clamp=None, se_voltage_clamp=None, spikes_inputs=None, config_file='config.json', overwrite_config=False, **run_args)
  property components_dir
  property examples_dir
  property network_dir
  property node_sets_file
  property output_dir
  property scripts_root
  property target_simulator

class bmtk.utils.sim_setup.FilterNetEnvBuilder(base_dir='.', network_dir=None, components_dir=None, output_dir=None, node_sets_file=None)

  Bases: `EnvBuilder`

  property bmtk_simulator
  property examples_dir
  property target_simulator

class bmtk.utils.sim_setup.PointNetEnvBuilder(base_dir='.', network_dir=None, components_dir=None, output_dir=None, node_sets_file=None)

  Bases: `EnvBuilder`

  property bmtk_simulator
  property examples_dir
  property target_simulator

class bmtk.utils.sim_setup.PopNetEnvBuilder(base_dir='.', network_dir=None, components_dir=None, output_dir=None, node_sets_file=None)

  Bases: `EnvBuilder`

  property bmtk_simulator
  property examples_dir
  property target_simulator

bmtk.utils.sim_setup.build_env_bionet(base_dir='.', network_dir=None, components_dir=None, node_sets_file=None, include_examples=False, overwrite_config=False, tstart=0.0, tstop=1000.0, dt=0.001, dL=20.0, spikes_threshold=-15.0, nsteps_block=5000, v_init=-80.0, celsius=34.0, report_vars=[], report_nodes=None, clamp_reports=[], current_clamp=None, file_current_clamp=None, se_voltage_clamp=None, spikes_inputs=None, compile_mechanisms=False, use_relative_paths=True, config_file=None)

bmtk.utils.sim_setup.build_env_filternet(base_dir='.', network_dir=None, components_dir=None, node_sets_file=None, include_examples=False, tstart=0.0, tstop=1000.0, config_file='config.json')

bmtk.utils.sim_setup.build_env_pointnet(base_dir='.', network_dir=None, components_dir=None, node_sets_file=None, include_examples=False, tstart=0.0, tstop=1000.0, dt=0.001, dL=20.0, spikes_threshold=-15.0, nsteps_block=5000, v_init=-80.0, celsius=34.0, report_vars=[], report_nodes=None, current_clamp=None, spikes_inputs=None, use_relative_paths=True, config_file=None)

bmtk.utils.sim_setup.build_env_popnet(base_dir='.', network_dir=None, components_dir=None, node_sets_file=None, reports=None, include_examples=True, config_file=None, tstart=0.0, tstop=1000.0, dt=0.001, **args)

## Module contents