infostop icon indicating copy to clipboard operation
infostop copied to clipboard

Can't suppress verbose infomap output in python 3.6

Open dkori opened this issue 5 years ago • 2 comments

I developed code that used infostop in python 3.7.1. When I run the algorithm with the "verbose=False" option, the option seems to function correctly and no output is printed.

However, I am currently trying to run these scripts in a remote environment where only python 3.6 is available, and despite using the verbose=False option, running the code prints an output like the sample below:

  Infomap v1.1.3 starts at 2020-07-12 20:16:14
  -> Input network: 
  -> No file output!
  -> Configuration: two-level
=======================================================
  -> Ordinary network input, using the Map Equation for first order network flows
Calculating global network flow using flow model 'undirected'... 
  -> Using undirected links.
  => Sum node flow: 1, sum link flow: 1
Build internal network with 6 nodes and 15 links...
Calculating one-level codelength... done!
 -> One-level codelength: 2.5849625
Calculating entropy rate... done!
  -> Entropy rate: 1.151148433

================================================
Trial 1/1 starting at 2020-07-12 20:16:14
================================================
Two-level compression: 3.4e-14% 
Partitioned to codelength 1.11022302e-16 + 2.5849625 + 0 = 2.584962501 in 1 (0 non-trivial) modules.

=> Trial 1/1 finished in 7.4e-05s with codelength 2.5849625


================================================
Summary after 1 trial
================================================
Best end modular solution in 2 levels:
Per level number of modules:         [          1,           0] (sum: 1)
Per level number of leaf nodes:      [          0,           6] (sum: 6)
Per level average child degree:      [          1,           6] (average: 5.28571)
Per level codelength for modules:    [0.000000000, 0.000000000] (sum: 0.000000000)
Per level codelength for leaf nodes: [0.000000000, 2.584962501] (sum: 2.584962501)
Per level codelength total:          [0.000000000, 2.584962501] (sum: 2.584962501)

===================================================
  Infomap ends at 2020-07-12 20:16:14
  (Elapsed time: 0.000451s)
===================================================
=======================================================

The python 3.6 environment has infostop 0.1.6 and infomap 1.1.3 installed. Is there any way to suppress the infomap output when using Python 3.6?

dkori avatar Jul 12 '20 20:07 dkori

The verbose argument is to limit the output displayed by Python. This is output displayed by Infomap. But it would make sense to not yield output from Infomap at all. Will have a look.

ulfaslak avatar Jul 19 '20 12:07 ulfaslak

Check the latest commit 48446a346e2ff5115183cbe28c08f0f2ea22e55a, does it solve your problem? I basically just supress Infomap output when verbose==False.

ulfaslak avatar Jul 19 '20 12:07 ulfaslak