Shift-Robust-GNNs icon indicating copy to clipboard operation
Shift-Robust-GNNs copied to clipboard

Suggest to loosen the dependency on networkx

Open Agnes-U opened this issue 1 year ago • 0 comments

Hi, your project Shift-Robust-GNNs requires "networkx==2.5" in its dependency. After analyzing the source code, we found that some other versions of networkx can also be suitable without affecting your project, i.e., networkx 2.5.1. Therefore, we suggest to loosen the dependency on networkx from "networkx==2.5" to "networkx>=2.5,<=2.5.1" to avoid any possible conflict for importing more packages or for downstream projects that may use Shift-Robust-GNNs.

May I pull a request to loosen the dependency on networkx?

By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



For your reference, here are details in our analysis.

Your project Shift-Robust-GNNs(commit id: 28ddefd021d21c59f71cd16afd1a95bc13705bea) directly uses 4 APIs from package networkx.

networkx.classes.graph.Graph.__init__, networkx.convert.from_dict_of_lists, networkx.algorithms.centrality.betweenness._single_source_shortest_path_basic, networkx.linalg.graphmatrix.adjacency_matrix

From which, 2 functions are then indirectly called, including 1 networkx's internal APIs and 1 outsider APIs, as follows (neglecting some repeated function occurrences).

[/GentleZhu/Shift-Robust-GNNs]
+--networkx.classes.graph.Graph.__init__
|      +--networkx.convert.to_networkx_graph
|      |      +--networkx.convert.from_dict_of_dicts
|      |      +--networkx.convert.from_dict_of_lists
|      |      +--warnings.warn
|      |      +--networkx.convert.from_edgelist
+--networkx.convert.from_dict_of_lists
+--networkx.algorithms.centrality.betweenness._single_source_shortest_path_basic
+--networkx.linalg.graphmatrix.adjacency_matrix

We scan networkx's versions among [2.5.1] and 2.5, the changing functions (diffs being listed below) have none intersection with any function or API we mentioned above (either directly or indirectly called by this project).

diff: 2.5(original) 2.5.1
[](no clear difference between the source codes of two versions)

As for other packages, the APIs of @outside_package_name are called by networkx in the call graph and the dependencies on these packages also stay the same in our suggested versions, thus avoiding any outside conflict.

Therefore, we believe that it is quite safe to loose your dependency on networkx from "networkx==2.5" to "networkx>=2.5,<=2.5.1". This will improve the applicability of Shift-Robust-GNNs and reduce the possibility of any further dependency conflict with other projects/packages.

Agnes-U avatar Nov 22 '22 15:11 Agnes-U