imagepy
imagepy copied to clipboard
Bugs in the Network tool
For the network tool to work with Python 3.7.6, we need some changes:
- at most
networkxpackage version 2.1. Reason: thenodeattribute no longer exists as of version 2.4 (see here) - correct variable
nton.astype(np.int16)in lines 45, 46 of module graphpen_tol: https://github.com/Image-Py/imagepy/blob/17aa2927bc1216a8956b6a6f8173817cdd9481bb/imagepy/tools/Network/graphpen_tol.py#L45 https://github.com/Image-Py/imagepy/blob/17aa2927bc1216a8956b6a6f8173817cdd9481bb/imagepy/tools/Network/graphpen_tol.py#L46 and similarly in module graphcut_tol: https://github.com/Image-Py/imagepy/blob/17aa2927bc1216a8956b6a6f8173817cdd9481bb/imagepy/tools/Network/graphcut_tol.py#L44 https://github.com/Image-Py/imagepy/blob/17aa2927bc1216a8956b6a6f8173817cdd9481bb/imagepy/tools/Network/graphcut_tol.py#L45 Reason: with numpy version 1.18.1, I get the error message:TypeError: 'float' object cannot be interpreted as an integer
Remark: the reason why the "Build Graph" tool works in the standalone Windows version is because it uses networkx 2.2. In fact, the previously mentioned issue with the node attribute was deprecated since version 2.2, and was removed in version 2.4.
I just replace all the "node[" by "nodes[", And now every thing is ok for me. I had pushed. have a try?
Yes, that solves the problem, as expected. You need to make the changes in /menus/Analysis/Skeleton Network/graph_plgs.py and in /ipyalg/graph/sknw.py.
The other modification I proposed concerning linspace also works.
Also note that the issue with .node also concerns your sknw repository.
Another error found in graph_plgs.py: connected_component_subgraphs is removed. For a solution, see the related issue https://github.com/rkistner/chinese-postman/issues/21.