MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / add_spells

Method add_spells

easygraph/readwrite/gexf.py:852–861  ·  view source on GitHub ↗
(self, data, node_or_edge_xml)

Source from the content-addressed store, hash-verified

850 return data
851
852 def add_spells(self, data, node_or_edge_xml):
853 spells_element = node_or_edge_xml.find(f"{{{self.NS_GEXF}}}spells")
854 if spells_element is not None:
855 data["spells"] = []
856 ttype = self.timeformat
857 for s in spells_element.findall(f"{{{self.NS_GEXF}}}spell"):
858 start = self.python_type[ttype](s.get("start"))
859 end = self.python_type[ttype](s.get("end"))
860 data["spells"].append((start, end))
861 return data
862
863 def add_edge(self, G, edge_element, edge_attr):
864 # add an edge to the graph

Callers 2

add_nodeMethod · 0.95
add_edgeMethod · 0.95

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected