networkx / networkx

Network Analysis in Python
https://networkx.org
Other
14.76k stars 3.21k forks source link

Followup ideas from the `_dispatch` code audit #6804

Open dschult opened 1 year ago

dschult commented 1 year ago

PR #6688 required going through a lot of our code base and finding out which input arguments were treated how. In that PR, many comments were created and attached to various parts of our codebase. This Issue attempts to collect the comments that didn't lead to an immediate solution or answer. The idea is to check them off when we either resolve them or decide not to resolve them. If I've missed something please add it in the comments and I'll try to put it on the list via editing.

Timing impact

API warts:

Misc notes:

Questions:

Q: how to handle create_using inputs when dispatching?

For the future, perhaps we should:

MridulS commented 1 year ago

Putting this here from https://github.com/networkx/networkx/pull/6688/files#issuecomment-1652314158

aaronzo commented 1 year ago

Extra point on quotient_graph - though it's a pattern that could repeat: The function takes a weight parameter (since #6814), but this is only used by the function logic if another parameter, edge_data is None. Therefore there is efficiency lost in keeping the weight attribute if edge_data != None. This also applies to the open PR #6557.