New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve test coverage for Steiner Tree & Docs #7348
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM, and thanks for the cleanup of things I missed in #7337 🚀
Just one note about how to structure the default method test, but other than that LGTM!
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, thanks @vanshika230 !
The dispatching tests are failing but I'm not sure why... @eriknw any ideas?
Thanks for the ping! You can expect me to be around to help with issues like this. This is a good data point, and I suppose we should make the assertion message more informative. EDIT: this is not the best solution. See my next reply I debugged this locally, and the solution is to change the @nx._dispatchable(edge_attrs={"weight": None}, returns_graph=True) The issue is that |
Correction--use this @nx._dispatchable(preserve_all_attrs=True, returns_graph=True) The returned graph preserves edge, node, and graphs attributes from the original graph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is very helpful!
* Improve test coverage for Steiner Tree & Docs * Update networkx/algorithms/approximation/steinertree.py Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * Update networkx/algorithms/approximation/steinertree.py Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * Update networkx/algorithms/approximation/tests/test_steinertree.py Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * Update test_steinertree.py * Update test_steinertree.py * Update dispatch decorator. --------- Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
I have increased test coverage for Steinertree.py according to here :-
https://app.codecov.io/gh/networkx/networkx/blob/main/networkx%2Falgorithms%2Fapproximation%2Fsteinertree.py
It is now at 100% as seen below:-
I have also added Raises to docstrings and changed the default from kou to mehlhorn according to recent changes.