Tamás Nepusz
Tamás Nepusz
The `AttributeError: plotting not available` error appears when `import cairo` fails with an `ImportError`; we catch the exception and replace `cairo` with a fake module that raises an `AttributeError` for...
Anyway, we can try improving the `plotting not available` error message, but there's only so much we can put into an exception message (some environments might truncate the string). We...
For the record, I tried this again on Google Colab with the following script: ``` !pip install python-igraph import igraph as ig g = ig.Graph.Erdos_Renyi(n=100, m=200) ig.plot(g) ``` It still...
I was wondering how we could test for the presence of `matplotlib` without importing it. I'm a bit worried that importing `matplotlib` directly has side effects like the initialization of...
Maybe this? ``` import importlib spec = importlib.util.find_spec("matplotlib") found = spec is not None ```
> It seems you can depend on other arguments in the default argument, right? I think this would work, but you need to write something like `ifelse(is.null(weights), density(graph), weighted_density(graph))`. But...
Yup, but maybe for the sake of readability it's better to put it in the function body. I leave it up to you.
Moving this to a future release as the documentation was improved, and changing the default settings would be a potentially breaking change and I'd rather not re-run ~900 revdepchecks now...
I have just submitted an answer to the SO post - thanks for bringing it to my attention. `select()` is basically almost always doing a linear scan on the vertex...
It could be the case that the `incident()` method of the `Vertex` object is not in the latest public release yet. In that case, use: ``` eid = tree.incident(index, mode="in")[0]...