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

Method add_attributes

easygraph/readwrite/graphml.py:574–580  ·  view source on GitHub ↗

Appends attribute data to edges or nodes, and stores type information to be added later. See add_graph_element.

(self, scope, xml_obj, data, default)

Source from the content-addressed store, hash-verified

572 return data_element
573
574 def add_attributes(self, scope, xml_obj, data, default):
575 """Appends attribute data to edges or nodes, and stores type information
576 to be added later. See add_graph_element.
577 """
578 for k, v in data.items():
579 self.attribute_types[(str(k), scope)].add(type(v))
580 self.attributes[xml_obj].append([k, v, scope, default.get(k)])
581
582 def add_nodes(self, G, graph_element):
583 default = G.graph.get("node_default", {})

Callers 3

add_nodesMethod · 0.95
add_edgesMethod · 0.95
add_graph_elementMethod · 0.95

Calls 2

addMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected