networkx.utils.not_implemented_for¶
-
networkx.utils.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 : function
The decorated function.
Raises: NetworkXNotImplemnted
If any of the packages cannot be imported
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