Hi,

I'm using python-igraph (0.7.1) and when I save a graph with an integer
attribute as GraphML, attr.type= "double" is used instead of "int". See a
minimal example below.

Regards,

In [1]: import igraph as ig

In [2]: g = ig.Graph()

In [3]: g.add_vertex()

In [4]: g.vs["size"] = [1]

In [5]: g.vs[0]
Out[5]: igraph.Vertex(<igraph.Graph object at 0x7f25969f0430>,0,{'size': 1})

In [6]: g.write_graphml("test.graphml")

In [7]: %cat test.graphml
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
         http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd";>
<!-- Created by igraph -->
  <key id="v_size" for="node" attr.name="size" attr.type="double"/>
  <graph id="G" edgedefault="undirected">
    <node id="n0">
      <data key="v_size">1</data>
    </node>
  </graph>
</graphml>


-- 
Santiago Videla
http://www.linkedin.com/in/svidela
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to