Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automagic dispatch for universal functions (#883)
Follow up of #882, albeit more agressive on shortening the boilerplate amount of code for universal functions This PR introduces a new _rustworkx_dispatch decorator that: * Creates the singledispatch for func * Automatically registers digraph_func for PyDiGraph * Automatically registers graph_func for PyGraph The decorator is based on the original functools.singledispatch. It should simplify the amount of code we need to write an universal function. It does add a little bit of "magic" with functools and importlib, but overall it should be maintainable * Try to shorten Bellman-Ford * More shortening * Even more * Almost done with shortening * Finish shortening * Fix layout incorrect default arguments * Simplify distance_matrix * Magic custom dispatcher * Minor detail about is_isomorphic_node_match * Black * Use explicit package name * Minor change * Sync with main * Black * Minor fix * Sync with new functions * Synch with new functions * Fix cargo lock * Cargo.lock strikes again * Fix black error * Black fmt * Do not explicitly export rustworkx_dispatch
- Loading branch information