Usually the `scipy.cluster.hierarchy.dendrogram` function is used
to draw dendrograms.
It receives in input a matrix which encodes the hierarchical clustering
to be rendered as a dendrogram. For many cases it is enough to have this matrix generated by
the `scipy.cluster.hierarchy.linkage` function, but not so, for example, in graph community detection.
My module, `dendrogram_from_gn.py`, provides functions that generate
a matrix of this type (I named it `agglomerative matrix`) starting from the community reconstruction
of a graph, performed with the 'girvan_newman' function from 'networkx.algorithms.community.centrality'. The `agglomerative matrix` is
suitable to be taken in input by the
'scipy.cluster.hierarchy.dendrogram()' function. The module is mainly based on networkx, but it uses also `community_louvain.modularity` from `community` to compute the modularity of the graph partitions and possibly select the optimal partitioning.

--
You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to networkx-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/networkx-discuss/5627348c-c035-4eaa-b603-6a8dd0a76f7c%40googlegroups.com.
Hi!
Thank you Dan for your answer and you suggestions.
Few hours ago I did my Pull Request, but, as I wrote in the PR message, my code is not ready to be merged yet. In particular I need for some other advice:
1) I ask for reviews of the code of my module 'dendrogram_from_girvan_newman' in network/algorithms/community .
2) I added pointers in the doc/reference/algorithms/community.rst file to automatically generate the documentation, but I'm not sure I did it correctly. I wasn't able to find guidelines for this.
3) I have not yet implemented the tests in the networkx/algorithms/community/tests folder. I'm asking for guidance: I've never used 'pytest' and I'm also not sure what I should test. In addition to checking if my functions work properly, should I add tests to check if the inputs are as I expect them to be? Should I check, for example, that a dictionary that is passed as input to a function has the right format?
Is there a detailed guide that explains how to implement the tests?
Thanks in advance for your help!
Francesco Bonacina
P.S. After the first PR I made some changes to be consistent with PEP8. Now I hope my code it's fine regarding that.
To view this discussion on the web visit https://groups.google.com/d/msgid/networkx-discuss/CA%2BXMcTNjVV33NouV00gSz0yTeYFz8WuTNUC2TmxBcO1DEFhVeQ%40mail.gmail.com.