antmd / graph-tool

graph-tool - Efficient network analysis
GNU General Public License v3.0
97 stars 5 forks source link

B_max keyword argument for minimize_blockmodel_dl throws error #7

Open mikk-c opened 2 years ago

mikk-c commented 2 years ago

On graph_tool 2.44:

Python 3.9.7 (default, Sep 10 2021, 14:59:43) 
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import graph_tool.all as gt
>>> g = gt.collection.data["celegansneural"]
>>> gt.minimize_blockmodel_dl(g, B_max = 4)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: minimize_blockmodel_dl() got an unexpected keyword argument 'B_max'
>>> gt.minimize_nested_blockmodel_dl(g, B_max = 4)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: minimize_nested_blockmodel_dl() got an unexpected keyword argument 'B_max'

Expected behavior: the functions should find partitions with at most 4 blocks, as described in the documentation: https://graph-tool.skewed.de/static/doc/inference.html#graph_tool.inference.minimize_blockmodel_dl

welkiej7 commented 10 months ago

Hello @mikk-c

This is normal due to the fact that graph_tool.minimize_blockmodel_dl does not expect the argument B_max since B_maxis not a parameter listed as can be seen in the documentation here.

graph_tool.minimize_blockmodel_dl may take four arguments: the graph, the state to be used, a dictionary that may contain the arguments for the related state constructor, and finally, a dictionary with arguments passed to the multilevel agglomerative MCMC sweeps.

me9hanics commented 8 months ago

I get the same error with running minimize_nested_blockmodel_dl(g, B_max = 20), as the returned error suggested in OP's case. minimize_nested_blockmodel_dl(g2, **{'B_max':'20'}) returns the same.

The argument should not be a problem according to the documentation.

Maybe @count0 knows the fix?

count0 commented 8 months ago

This is NOT the official repository of graph-tool! It's a clone someone made over 9 years ago!

The actual repository is here: https://git.skewed.de/count0/graph-tool

If you want the developers to actually see your issues, please post there!