Closed tanlin2013 closed 6 months ago
This is not a bug, but the behaviour does seem confusing. See the docs:
https://python.igraph.org/en/stable/api/igraph.GraphBase.html#layout_bipartite
The partitions are taken from the "types"
attribute by default, which is not present here. You need to provide the partitions.
You can do this:
(bipartite, types) = g.is_bipartite(return_types=True)
g.layout_bipartite(types)
@ntamas It might be nice to make that error message a bit better and state which attribute was not found. But perhaps we don't have the resources now, and should focus on the new interface. It'd be nice the have a more convenient default behaviour in the new interface, such as: take types
if that attribute exists, but otherwise automatically compute bipartite partitions (and fail if the graph is not bipartite). In the Mathematica interface I automatically compute partitions by default, and allow specifying them manually otherwise.
I see, thanks for answering! It works now.
I agree this is a bit confusing. Perhaps a temporary fix would be to write a few more words on the documentation?
You may keep this post or close it now.
I submitted PR #773 to try to improve error messages a little bit.
Describe the bug When calling
g.layout_bipartite()
, I got the errorI have tried to reinstall the package, but it doesn't help.
To reproduce
Version information