Menu

#2 Inconsistency in edge_data getters/setters

open
nobody
None
5
2005-06-28
2005-06-28
No

There seems to be inconsistency in the system as to
how the edge data getters and setters interface with the
self._edge_data dict. Sometimes keys are assumed to
be edge ids and other times node_pairs. This leads
to "funny" results.

DGraph.__init__ does:
self._edge_data[node_pair] = data

DGraph.set_edge_data does
self._edge_data[edge_id] = edge_data

DGraph.get_edge_data does
node_pair = self.edge_nodes(edge)
return self._edge_data.get(node_pair, None)
(and has incorrect docstring btw)

DGraph.edge_data does
return self._edge_data.get(edge, None)

Also, I'm confused as to why there is both a
get_edge_data and an edge_data method.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.