superneuromat.SNN.to_networkx#

SNN.to_networkx(include_attributes=True)[source]#

Convert the SNN to a networkx.DiGraph with neurons represented by int ids.

The returned graph can be saved to a file using functions such as networkx.write_graphml().

Parameters:

include_attributes (bool, default=True) – If True, include the attributes of the neurons and synapses in the graph. The included attributes are generated in Neuron.attributes_dict and Synapse.attributes_dict. If False, only the graph structure is included.

Returns:

The networkx.DiGraph representation of the SNN.

Return type:

networkx.DiGraph

See also

to_networkx_accessors

Create a NetworkX graph with Neuron objects as nodes.

Notes

By default, the graph will not contain spike information.

Examples

>>> import networkx as nx
>>> snn = superneuromat.SNN()
>>> G = snn.to_networkx()
>>> nx.write_graphml(G, "snn.graphml")