Zum Inhalt

supplier

dsstools.supplier

NxElementView = TypeVar('NxElementView', NodeDataView, EdgeDataView, OutEdgeDataView, InEdgeDataView, Iterator[tuple]) module-attribute

logger = get_logger(__name__) module-attribute

EgoNetwork(ego)

Bases: Supplier

Class for matching graphelements to their role in an ego-network and supplying EgoMapping.

Parameters:

Name Type Description Default
ego str | int

name of the node at the center of the ego-network

required

ego = ego instance-attribute

fallback = None instance-attribute

ElementAttribute(keyword)

Bases: Supplier

Class for graph element values (already set in the graph.

Parameters:

Name Type Description Default
keyword str

the key of the inherent attribute

required

fallback = None instance-attribute

keyword: str = keyword class-attribute instance-attribute

__repr__()

__str__()

IncorrectKeyword

Bases: Exception

Percentile(supplier)

Bases: Supplier

Class for filtering an existing supplier by the percentile.

Parameters:

Name Type Description Default
supplier Supplier

Supplier whose values will be evaluated based on the percentile range, must contain numeric values

required

fallback = None instance-attribute

percentile_method = 'linear' instance-attribute

percentile_range = None instance-attribute

supplier = supplier instance-attribute

RawDictionary(dictionary)

Bases: Supplier

Assign a dictionary to the graph elements.

This can be a subgraph or a normal graph. The keys must match at least one of the node ids or edge tuples. Example: The dictionaries returned by NetworkX calculations on graphs return suitable dictionaries

Parameters:

Name Type Description Default
dictionary dict

key is GraphElement, value is value to be supplied

required

dictionary = dictionary instance-attribute

fallback = None instance-attribute

StructuralAttribute(keyword=None, *, reverse=False, alt_nx_calculation=None)

Bases: Supplier

Class for providing structural graph element values.

These are attributes based on the graph structure and need to be calculated.

Parameters:

Name Type Description Default
keyword Optional[str]

the keyword for the calculation

None
reverse bool

determines if the calculation should use inverted edge values if True, default False

False

ATTRIBUTES = ['indegree', 'outdegree', 'degree', 'centrality', 'betweenness', 'closeness'] class-attribute instance-attribute

__keyword: str | None = keyword.lower() if keyword is not None else None instance-attribute

alt_nx_calculation = alt_nx_calculation if keyword is None else None instance-attribute

fallback = None instance-attribute

reverse = reverse instance-attribute

Supplier()

Bases: ABC

Basic interface for supplying graph element values.

fallback = None instance-attribute