snap-python icon indicating copy to clipboard operation
snap-python copied to clipboard

TypeError: in method 'GetModularity_PNGraph', argument 2 of type 'TInt64V const &'

Open Lizhen0909 opened this issue 7 years ago • 5 comments

I found the error with snap-5.0.9-64-3.0-centos6.5-x64-py3.6.tar.gz when running example code

import snap

Nodes = snap.TIntV()
for nodeId in range(10):
    Nodes.Add(nodeId)

Graph = snap.GenRndGnm(snap.PNGraph, 100, 1000)
print (snap.GetModularity(Graph, Nodes, 1000))

Lizhen0909 avatar Nov 01 '18 03:11 Lizhen0909

hello I have met the same error. do you have found some methods to fix it?

Thx

mengyingzhou avatar Jan 09 '19 05:01 mengyingzhou

@Lizhen0909 Hi After checking the original code, I found the solution. They change the type from Int to int64. So, we just need to modify the code from TIntPrV to TIntPr64V. Other similar errors can be solved with this method.

thx aerber

mengyingzhou avatar Jan 09 '19 06:01 mengyingzhou

This actually seems to be a problem with a number of functions in the Python 3.6 version. Is this likely to be solved in a coming update?

ChasNelson1990 avatar Jul 09 '19 15:07 ChasNelson1990

@ChasNelson hi. you can use the above solution i answered when you get the similar error.

mengyingzhou avatar Jul 09 '19 15:07 mengyingzhou

Sorry, I think I misunderstood and thought you were recommending changing the C code for each error. Got ya now - thanks!

ChasNelson1990 avatar Jul 09 '19 16:07 ChasNelson1990