python-igraph icon indicating copy to clipboard operation
python-igraph copied to clipboard

Documentation for Edge is incomplete

Open jchia opened this issue 1 year ago • 6 comments

Describe the bug The documentation for Edge (https://python.igraph.org/en/main/api/igraph.Edge.html) is incomplete. It fails to mention source, target, tuple, graph, index, source_vertex at all, among other things.

To reproduce Just view the documentation page at the URL.

Version information Latest or stable.

jchia avatar Feb 17 '25 11:02 jchia

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 27 '25 17:04 stale[bot]

Any updates?

jchia avatar Apr 28 '25 02:04 jchia

I took a look at this now; apparently it seems that pydoctor does not recognize properties defined in classes implemented in C code automatically as it relies on parsing the Python source of the class, which is not accessible in this case. I'll check whether there's a way to tell PyDoctor the list of properties explicitly.

ntamas avatar Apr 28 '25 12:04 ntamas

Unfortunately this seems to be an issue with pydoctor. pydoctor uses obj.__dict__.items() to iterate over all the members of a class to find out which ones are to be documented. The items that are missing from the documentation never appear in obj.__dict__, and even adding them manually to the class docstring with @ivar does not seem to help - the list of items to be documented in a class is still decided by obj.__dict__.items().

The only option that we have right now (without patching pydoctor) would be to just document the missing attributes in the class docstring in plain text. They would not appear in the list of class members but at least they would be mentioned in the HTML docs. Would that be OK for you?

ntamas avatar Apr 28 '25 14:04 ntamas

Yes, that would be an improvement over the current situation, where the functions are not discoverable from the documentation alone so the reader would not know what he is missing.

jchia avatar Apr 28 '25 14:04 jchia

Adding @ivar fields in the class docstring should create attribute entries for these names. If you think you've hit a bug in pydoctor , please open an issue! Thanks

tristanlatr avatar Jun 27 '25 16:06 tristanlatr