igraph-help
[Top][All Lists]
Advanced

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

[igraph] Attribute type when saving to GraphML


From: Santiago Videla
Subject: [igraph] Attribute type when saving to GraphML
Date: Mon, 1 Jun 2015 19:11:57 -0300

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="" 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

reply via email to

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