-
Notifications
You must be signed in to change notification settings - Fork 195
Extend docstrings for some graph connectivity methods #1399
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
Conversation
Pull Request Test Coverage Report for Build 14000177981Details
💛 - Coveralls |
IvanIsCoding
left a comment
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.
LGTM. Thanks for adding the examples on the docstrings. I think our documentation suffers from lacks of examples.
It is mostly that when contributing new code, we already need to add Rust code + Python bindings + tests + type annotations + a release note. So by the time authors get to the docstring, they are tired. I like this approach of refining docstrings after the fact.
For missing methods: again, similar fate from #1397. @eumiro if you could send a new PR editing this file docs/source/api/algorithm_functions/connectivity_and_cycles.rst, that would fix the issue. I can't believe we had methods undocumented for so long!
|
Re: I don't foresee us migrating to |
|
Last but not least: API inconsitencies. The methods were added by different people at different times. I don't think when Matthew wrote the earlier versions, he thought we'd have as big of a user base. We have also a policy of avoiding breaking changes at all costs. For example, we have purposefully kept some API mistakes like having a sub-optimal order of Python arguments because changing the order would break users. We might fix those things for 1.0 one day, so maybe comment on #1000 some improvements you can think of. Or just open a new issue. |
|
Thanks for the feedback, @IvanIsCoding . I find Rustworkx very useful for some of my use cases and while I approximately know, what I expect from my graphs, I do not always know the names of the methods/concepts, so I have to search around docs a lot (and learn stuff at the same time!). This is how I got the motivation to improve the docs for the Am I searching in the wrong place? I cannot find the four missing methods from my top post at all. The only place where I find I first thought these methods were not commonly used in the graph theory, but while networkx does not have the two And I understand your preference for |
This should help new users to discover related methods and understand the method signature with simple examples. I believe there's enough space on the API docs website for more material.
I didn't find the following methods:
number_strongly_connected_components,is_strongly_connected,number_semi_connected_components, andsemi_connected_components. Otherwise I'd like to cross-reference them in the related docstrings.Also I found it a bit confusing that
connected_componentsandweakly_connected_componentsreturn a list of sets, whereasstrongly_connected_componentsreturns a list of lists, although the concept is similar.OT: Did you actually consider using pytest for tests?