MCPcopy Create free account
hub / github.com/alibaba/graph-learn / set_path

Method set_path

graphlearn/python/gsl/dag_node.py:109–121  ·  view source on GitHub ↗
(self, path, node_from)

Source from the content-addressed store, hash-verified

107 return self._neg_downstreams
108
109 def set_path(self, path, node_from):
110 assert isinstance(path, str)
111 assert isinstance(node_from, pywrap.NodeFrom)
112 topo = self._graph.get_topology()
113 path_to_type = {pywrap.NodeFrom.NODE: lambda x: x,
114 pywrap.NodeFrom.EDGE_SRC: topo.get_src_type,
115 pywrap.NodeFrom.EDGE_DST: topo.get_dst_type}
116 self._path = path
117 self._type = path_to_type.get(node_from)(path)
118 if self._type in self._graph.get_node_decoders().keys():
119 self._decoder = self._graph.get_node_decoder(self._type)
120 else:
121 self._decoder = self._graph.get_edge_decoder(self._type)
122
123 def _add_param(self, name, value):
124 self._params[name] = value

Callers 7

VMethod · 0.80
EMethod · 0.80
_new_edge_nodeMethod · 0.80
_new_vertex_nodeMethod · 0.80
inVMethod · 0.80
outVMethod · 0.80
inVMethod · 0.80

Calls 6

get_topologyMethod · 0.80
get_node_decodersMethod · 0.80
get_node_decoderMethod · 0.80
get_edge_decoderMethod · 0.80
getMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected