nicoloval/NEMtropy

ECM_EXP for non-integer weights

Closed this issue · 1 comments

Hi,

First, thanks for providing such a package. I'm trying to use it to generate null models for a weighted undirected network (N=200, ~=10). The weights are in the range of 0.001 and 0.1 . However, the generated networks have integer weights instead of float values.

I'm using the following code:

G = nx.read_edgelist(networkFilename)
adj_kar = nx.to_numpy_array(G,dtype=float)
graph = UndirectedGraph(adj_kar)

graph.solve_tool(model="ecm_exp",
                method="newton",
                initial_guess="random",
                linsearch=True)
graph.ensemble_sampler(1, cpu_n=1, output_dir=outputDir+"/")

Also, sometimes the whole process stalls. I solved this by adding a timeout of 5 minutes to the process generating the networks.

Running it on Linux.

Ops. In fact the method I was looking for was CReMa and not ECM_EXP. It is working fine and it never stalls. I'm closing the issue.