Skip to content

Commit 4bd559f

Browse files
committed
fixed trim function
1 parent 6c1bd0c commit 4bd559f

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

csnanalysis/committor.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

csnanalysis/csn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def add_attr(self, name, values):
7474

7575
nx.set_node_attributes(self.graph,name,attr)
7676

77-
def trim_graph(self, by_inflow=True, by_outflow=True, min_count=0):
77+
def trim(self, by_inflow=True, by_outflow=True, min_count=0):
7878
"""
7979
Trims a graph to delete nodes that are not connected to the main
8080
component, which is the component containing the most-sampled node (MSN)
@@ -108,7 +108,7 @@ def trim_graph(self, by_inflow=True, by_outflow=True, min_count=0):
108108
mask[[i for i in range(self.nnodes) if i not in upstream]] = False
109109

110110
if min_count > 0:
111-
mask[[i for i in range(self.nnodes) if totcounts[i] >= min_count]] = False
111+
mask[[i for i in range(self.nnodes) if totcounts[i] < min_count]] = False
112112

113113
self.trim_indices = [i for i in range(self.nnodes) if mask[i] is True]
114114
self.trim_graph = self.graph.subgraph(self.trim_indices)

0 commit comments

Comments
 (0)