Shared¶
Class Description¶
- class paminco.net.Shared(edge_data, node_data=None, dtype_float=<class 'numpy.float64'>, dtype_int=<class 'int'>, **kwargs)[source]¶
Class that acts as a shared object for a Network.
Consists mainly of nodes and edges object, handles label and index mappings.
- Parameters
- edge_datatuple of ndarray
Data to construct Edges object.
- node_dataarray_like or tuple of ndarray, optional
Data to construct Nodes object.
- dtype_floatdtype, default=numpy.float_
Datatype for all float ndarray.
- dtype_intdtype, default=int
Datatype for all int ndarray.
Methods¶
Update internal node and edge mappings. |
|
|
|
|
Delete edge(s) from Edges object. |
|
Delete node(s) from Nodes object. |
|
Delete node(s) from Edges object. |
|
Alias for |
|
Return the incidence matrix Gamma of the network. |
|
Alias for |
|
Get the compressed sparse graph, shape (n, n). |
|
Map node indices to edge indices. |
|
Map labels in nodes to node indices. |
|
Map indices in nodes to node labels. |
|
Load object from |
|
Generate dict to save object with numpy.savez. |
|
Save object into a single file in uncompressed |
|
Load Shared from .npz file. |
Attributes¶
edges |
Get |
nodes |
Get |
The direction of flow on the edges. |
|
Get number of nodes in network. |
|
Get number of edges in network. |
|
Get dict that maps (node_id, node_id) -> edge_id. |
|
Get dict that maps node label (str) -> node id (int). |
|
Get int data type, used for node ids in network. |
|
Get float dtype for network. |