networkx_temporal.typing

Type hints exclusively used in function definitions.

Summary

Literal

Type for typing.Literal with Python 3.7 support.

Figure

Type for matplotlib.figure.Figure objects.

StaticGraph

Type for any networkx graph objects.

TemporalGraph

Type for TemporalGraph objects.

TemporalDiGraph

Type for TemporalDiGraph objects.

TemporalMultiGraph

Type for TemporalMultiGraph objects.

TemporalMultiDiGraph

Type for TemporalMultiDiGraph objects.

Note

Type hints are used to specify the type of arguments and return values in function definitions only, and may not be used to check an object type at runtime, as demonstrated in the example below.

>>> from networkx_temporal import TemporalGraph
>>> from networkx_temporal.typing import TemporalGraph as TemporalGraphType
>>>
>>> TG = TemporalGraph()
>>> isinstance(TG, TemporalGraph), isinstance(TG, TemporalGraphType)

(True, False)

Note

The convenience functions is_temporal_graph() and is_static_graph() may be used instead to check if an object is an instance of a temporal or static NetworkX graph.