igraph / python-igraph

Python interface for igraph
GNU General Public License v2.0
1.31k stars 249 forks source link

refactor: better error messages for non-existent attributes #773

Closed szhorvat closed 6 months ago

szhorvat commented 6 months ago

See #772 for the motivation. Tested manually:

>>> import igraph as ig
>>> ig.Graph([(0,1)]).layout_bipartite()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/szhorvat/miniconda3/envs/igdev/lib/python3.11/site-packages/igraph/layout.py", line 691, in result
    layout = func(*args, **kwds)
             ^^^^^^^^^^^^^^^^^^^
igraph._igraph.InternalError: Error at src/_igraph/attributes.c:1701: No vertex attribute named "type" exists. -- Invalid value
ntamas commented 6 months ago

Thanks!