- class graphicle.data.AdjacencyList(graphicle.base.AdjacencyBase)[source]
Describes relations between particles in particle set using a COO edge list, and provides methods to convert representation.
New in version 0.1.0.
Changed in version 0.2.4: Added internal numpy interfaces for greater interoperability.
Changed in version 0.3.0: Renamed “in” / “out” fields to “src” / “dst”.
- Parameters:¶
- data : ndarray[int32] or ndarray[void]
COO formatted edge pairs, either given as a (n-2)-dimensional array, or a structured array with field names
('src', 'dst').- weights : np.ndarray[float64]
Weights attributed to each edge in the COO list.
Public members¶
- copy() AdjacencyList[source]
Copies the underlying data into a new AdjacencyList instance.
- property data : ndarray[Any, dtype[void]][source]
Underlying array data. Identical to
edgesattribute, included for consistency withbase.ArrayBasenumpyinterfaces.
- property nodes : ndarray[Any, dtype[int32]][source]
Vertex ids of each particle with at least one edge.
- property matrix : ndarray[Any, dtype[float64]] | ndarray[Any, dtype[int32]][source]
Exposes the adjacency as a dense matrix, \(A_{ij}\).
- classmethod from_matrix(adj_matrix, ...) AdjacencyList[source]
Construct an AdjacencyList object from an optionally weighted adjacency matrix.
-
to_sparse(data: ndarray[Any, dtype[Any]] | None =
None) coo_array[source] Converts the graph structure to a
scipy.sparse.coo_arrayinstance.
- serialize() tuple[VertexPair, ...][source]
Provides a serialized version of the underlying data.
- __setattr__(name, val)[source]
Method generated by attrs for class AdjacencyList.
- AdjacencyList(...)[source]
Method generated by attrs for class AdjacencyList.
- index(value, ...) integer -- return first index of value.[source]
Raises ValueError if the value is not present.
- classmethod __subclasshook__(C)[source]
Abstract classes can override this to customize issubclass().
-
AdjacencyList =
<bound method GenericAlias of <class 'collections.abc.Iterable'>>[source]
Last update:
Jun 27, 2025