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.

weights[source]

Scalar value embedded on each edge.

Type:

ndarray[float64]

Public members

__repr__() str[source]

Return repr(self).

__eq__(other: ArrayBase | ndarray[Any, dtype[Any]]) MaskArray[source]

Return self==value.

__ne__(other: ArrayBase | ndarray[Any, dtype[Any]]) MaskArray[source]

Return self!=value.

__getitem__(key) AdjacencyList[source]
copy() AdjacencyList[source]

Copies the underlying data into a new AdjacencyList instance.

property data : ndarray[Any, dtype[void]][source]

Underlying array data. Identical to edges attribute, included for consistency with base.ArrayBase numpy interfaces.

property edges : ndarray[Any, dtype[void]][source]

COO edge list, with field names ('src', 'dst').

property nodes : ndarray[Any, dtype[int32]][source]

Vertex ids of each particle with at least one edge.

property roots : MaskArray[source]

Provides a mask for selecting the roots of a DAG / tree.

property leaves : MaskArray[source]

Provides a mask for selecting the leaves of a DAG / tree.

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_array instance.

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.

dtype : dtype[source]
weights : ndarray[Any, dtype[float64]][source]
index(value, ...) integer -- return first index of value.[source]

Raises ValueError if the value is not present.

count(value) integer -- return number of occurrences of value[source]
classmethod __subclasshook__(C)[source]

Abstract classes can override this to customize issubclass().

AdjacencyList = <bound method GenericAlias of <class 'collections.abc.Iterable'>>[source]
__lt__(other)[source]

Return self<value.

__le__(other)[source]

Return self<=value.

__gt__(other)[source]

Return self>value.

__ge__(other)[source]

Return self>=value.

__or__(other)[source]

Return self|value.

__ror__(other)[source]

Return value|self.


Last update: Jun 27, 2025