Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

networkx.utils.decorators.not_implemented_for

not_implemented_for(*graph_types)[source]

Decorator to mark algorithms as not implemented

Parameters

graph_types (container of strings) – Entries must be one of ‘directed’,’undirected’, ‘multigraph’, ‘graph’.

Returns

_require – The decorated function.

Return type

function

Raises

Notes

Multiple types are joined logically with “and”. For “or” use multiple @not_implemented_for() lines.

Examples

Decorate functions like this:

@not_implemnted_for('directed')
def sp_function(G):
    pass

@not_implemnted_for('directed','multigraph')
def sp_np_function(G):
    pass