Core module¶
Core classes and functions. Most of them are not visible in the module as they
are directly loaded at nngt
level.
Content¶
-
class
nngt.core.
IGraph
(nodes=0, g=None, directed=True, parent=None)[source]¶ Bases:
abc.Mock
Subclass of
igraph.Graph
.-
__abstractmethods__
= frozenset([])¶
-
new_edge
(source, target, weight=1.0)[source]¶ Adding a connection to the graph, with optional properties.
Parameters: - source (
int/node
) – Source node. - target (
int/node
) – Target node. - weight (
double
, optional (default: 1.)) – Weight of the connection (synaptic strength with NEST).
Returns: The new connection.
- source (
-
new_node
(n=1, ntype=1)[source]¶ Adding a node to the graph, with optional properties.
Parameters: - n (int, optional (default: 1)) – Number of nodes to add.
- ntype (int, optional (default: 1)) – Type of neuron (1 for excitatory, -1 for inhibitory)
Returns: The node or an iterator over the nodes created.
-
-
class
nngt.core.
GtGraph
(nodes=0, g=None, directed=True, prune=False, vorder=None)[source]¶ Bases:
abc.Mock
Subclass of
graph_tool.Graph
that (withSnapGraph
) unifies the methods to work with either graph_tool or SNAP.-
__abstractmethods__
= frozenset([])¶
-
__init__
(nodes=0, g=None, directed=True, prune=False, vorder=None)[source]¶ @todo: document that see
graph_tool.Graph
‘s constructor
-
new_edge
(source, target, weight=1.0)[source]¶ Adding an edge to the graph, with optional properties.
Parameters: - source (
int/node
) – Source node. - target (
int/node
) – Target node. - weight (
double
, optional (default: 1.)) – Weight of the connection (synaptic strength with NEST).
Returns: The new edge.
- source (
-
new_edges
(edge_list, eprops=None)[source]¶ Adds a list of edges to the graph @todo: see how the eprops work
-
new_node
(n=1, ntype=1)[source]¶ Adding a node to the graph, with optional properties.
Parameters: - n (int, optional (default: 1)) – Number of nodes to add.
- ntype (int, optional (default: 1)) – Type of neuron (1 for excitatory, -1 for inhibitory)
Returns: The node or an iterator over the nodes created.
-
-
class
nngt.core.
NxGraph
(nodes=0, g=None, directed=True)[source]¶ Bases:
abc.Mock
Subclass of networkx Graph
-
__abstractmethods__
= frozenset([])¶
-
di_value
= {'int': 0, 'double': 0.0, 'string': ''}¶
-
new_edge
(source, target, weight=1.0)[source]¶ Adding a connection to the graph, with optional properties.
Parameters: - source (
int/node
) – Source node. - target (
int/node
) – Target node. - add_missing (
bool
, optional (default: None)) – Add the nodes if they do not exist. - weight (
double
, optional (default: 1.)) – Weight of the connection (synaptic strength with NEST).
Returns: The new connection.
- source (
-
new_node
(n=1, ntype=1)[source]¶ Adding a node to the graph, with optional properties.
Parameters: - n (int, optional (default: 1)) – Number of nodes to add.
- ntype (int, optional (default: 1)) – Type of neuron (1 for excitatory, -1 for inhibitory)
Returns: The node or an iterator over the nodes created.
-