bmtk.builder.networks package

Submodules

bmtk.builder.networks.dm_network module

class bmtk.builder.networks.dm_network.DenseNetwork(name, **network_props)[source]

Bases: bmtk.builder.network.Network

class EdgeTable(connection_map)[source]

Bases: object

has_target(node_id)[source]
property nsyn_table
property source_ids
property target_ids
trg_itr(trg_id)[source]
class PropertyTable(nvalues)[source]

Bases: object

itr_vals(src_id, trg_id)[source]
edges_iter(trg_gids, src_network=None, trg_network=None)[source]

Given a list of target gids, returns a generator for iteratoring over all possible edges.

It is preferable to use edges() method instead, it allows more flexibility in the input and can better indicate if their is a problem.

The order of the edges returned will be in the same order as the trg_gids list, but does not guarentee any secondary ordering by source-nodes and/or edge-type. If their isn’t a edge with a matching target-id then it will skip that gid in the list, the size of the generator can 0 to arbitrarly large.

Parameters
  • trg_gids – list of gids to match with an edge’s target.

  • src_network – str, only returns edges coming from the specified source network.

  • trg_network – str, only returns edges coming from the specified target network.

Returns

iteration of bmtk.build.edge.Edge objects representing given edge.

edges_table()[source]
import_nodes(nodes_file_name, node_types_file_name, population=None)[source]
property nedges

Returns the total number of edges for this network.

property nnodes

Returns the number of nodes for this network.

nodes_iter(node_ids=None)[source]
bmtk.builder.networks.dm_network.add_hdf5_attrs(hdf5_handle)[source]

bmtk.builder.networks.input_network module

bmtk.builder.networks.mpi_network module

class bmtk.builder.networks.mpi_network.MPINetwork(name, **network_props)[source]

Bases: bmtk.builder.networks.dm_network.DenseNetwork

edges_iter(trg_gids, src_network=None, trg_network=None)[source]

Given a list of target gids, returns a generator for iteratoring over all possible edges.

It is preferable to use edges() method instead, it allows more flexibility in the input and can better indicate if their is a problem.

The order of the edges returned will be in the same order as the trg_gids list, but does not guarentee any secondary ordering by source-nodes and/or edge-type. If their isn’t a edge with a matching target-id then it will skip that gid in the list, the size of the generator can 0 to arbitrarly large.

Parameters
  • trg_gids – list of gids to match with an edge’s target.

  • src_network – str, only returns edges coming from the specified source network.

  • trg_network – str, only returns edges coming from the specified target network.

Returns

iteration of bmtk.build.edge.Edge objects representing given edge.

save_nodes(nodes_file_name, node_types_file_name)[source]

Save the instantiated nodes in SONATA format files.

Parameters
  • nodes_file_name – file-name of hdf5 nodes file. By default will use <network.name>_nodes.h5.

  • node_types_file_name – file-name of the csv node-types file. By default will use <network.name>_node_types.csv

  • output_dir – Directory where network files will be generated. Default, current working directory.

  • force_overwrite – Overwrites existing network files.

bmtk.builder.networks.nxnetwork module

class bmtk.builder.networks.nxnetwork.NxNetwork(name, **network_props)[source]

Bases: bmtk.builder.network.Network

property nedges

Returns the total number of edges for this network.

property nnodes

Returns the number of nodes for this network.

bmtk.builder.networks.sparse_network module

class bmtk.builder.networks.sparse_network.SparseNetwork(name, **network_props)[source]

Bases: bmtk.builder.network.Network

Module contents