superneuromat.SNN.to_networkx#
- SNN.to_networkx(include_attributes=True)[source]#
Convert the SNN to a
networkx.DiGraphwith 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_dictandSynapse.attributes_dict. If False, only the graph structure is included.- Returns:
The
networkx.DiGraphrepresentation of the SNN.- Return type:
See also
to_networkx_accessorsCreate 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")