~tfardet/nngt-developers

NNGT: Bugfix - Correct plot and is_connected v1 APPLIED

~tfardet
Fix betweenness_distribution (and therefore docs)
Also correct
is_connected with nngt backend.

Tanguy Fardet (1):
  Bugfix - Correct doc and is_connected

 nngt/core/nngt_graph.py     | 8 ++++----
 nngt/plot/plt_properties.py | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.32.0
#567008 .build.yml cancelled
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~tfardet/nngt-developers/patches/24403/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH NNGT 1/1] Bugfix - Correct doc and is_connected Export this patch

~tfardet
From: Tanguy Fardet <tanguyfardet@protonmail.com>

---
 nngt/core/nngt_graph.py     | 8 ++++----
 nngt/plot/plt_properties.py | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/nngt/core/nngt_graph.py b/nngt/core/nngt_graph.py
index 2ed201a..a3e592f 100644
--- a/nngt/core/nngt_graph.py
+++ b/nngt/core/nngt_graph.py
@@ -491,19 +491,19 @@ class _NNGTGraph(GraphInterface):
            Whether to test connectedness with directed ("strong") or
            undirected ("weak") connections.
        '''
        num_nodes = g.node_nb()
        num_nodes = self.node_nb()

        # get adjacency matrix
        A = g.adjacency_matrix()
        A = self.adjacency_matrix()

        if mode == "weak" and g.is_directed():
        if mode == "weak" and self.is_directed():
            A = A + A.T

        visited = _dfs(A, 0)

        if len(visited) != num_nodes:
            return False
        elif mode == "strong" and g.is_directed():
        elif mode == "strong" and self.is_directed():
            visited = _dfs(A.T, 0)

            if len(visited) != num_nodes:
diff --git a/nngt/plot/plt_properties.py b/nngt/plot/plt_properties.py
index b104d54..b678990 100755
--- a/nngt/plot/plt_properties.py
+++ b/nngt/plot/plt_properties.py
@@ -320,7 +320,7 @@ def betweenness_distribution(
        axes = [ax1.twinx()]

        if num_axes == 2:
            ax2 = ax.twiny()
            ax2 = ax1.twiny()
            axes.append(ax2)
            ax1.grid(False, axis='x')
            ax1.yaxis.tick_right()
-- 
2.32.0