igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] trouble with attaching attributes in python igraph


From: Tamas Nepusz
Subject: Re: [igraph] trouble with attaching attributes in python igraph
Date: Wed, 9 Jul 2008 12:29:35 +0200

Hi Eytan,

Thanks for reporting that, I just committed a fix, see:
http://cneurocvs.rmki.kfki.hu/cgi-bin/archzoom.cgi/address@hidden/igraph--main--0.5--patch-524?log

-- Tamas

On 2008.07.09., at 3:23, Eytan Bakshy wrote:

Hello,

I have been using the attribute functionality of python igraph and ran into a few issues when attaching vertex and edge attributes:

If you do not specify n ahead of time, it seems like edge attributes and vertex attributes do not get set.

For example if I do:
  g = Graph([(0,1),(1,0)],edge_attrs={'a':[1,2]})
g.es.attribute_names() is empty,

but if I do:
  g = Graph(2, [(0,1),(1,0)],edge_attrs={'a':[1,2]})
g.es.attribute_names() has 'a'.

The same seems to hold true for vertex_attrs as well. I have a feeling that this has to do with shifting the parameters in Graph.__init__(), but I don't understand exactly how optional arguments work in python...


Also, if you pass a tuple instead of a list as a key of an attribute, python crashes with a Bus Error:
  g = Graph(2,[(0,1),(1,0)],edge_attrs={'a':(1,2)})


Thanks,

-eytan
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help





reply via email to

[Prev in Thread] Current Thread [Next in Thread]