Skip to content

Commit be0f6e2

Browse files
author
Anton Eriksson
committed
fix(python): Using directed=False should use undirected flow
1 parent e30870f commit be0f6e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

interfaces/python/infomap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _construct_args(args=None,
7070
# algorithm
7171
two_level=False,
7272
flow_model=None,
73-
directed=False,
73+
directed=None,
7474
use_node_weights_as_flow=False,
7575
to_nodes=False,
7676
teleportation_probability=_DEFAULT_TELEPORTATION_PROB,
@@ -170,8 +170,8 @@ def _construct_args(args=None,
170170
if flow_model is not None:
171171
args += " --flow-model {}".format(flow_model)
172172

173-
if directed:
174-
args += " --directed"
173+
if directed is not None:
174+
args += " --directed" if directed else " --flow-model undirected"
175175

176176
if use_node_weights_as_flow:
177177
args += " --use-node-weights-as-flow"

0 commit comments

Comments
 (0)