MCPcopy Create free account
hub / github.com/alibaba/GraphScope / PEval

Method PEval

python/graphscope/tests/unittest/test_udf_app.py:582–602  ·  view source on GitHub ↗
(frag, context)

Source from the content-addressed store, hash-verified

580
581 @staticmethod
582 def PEval(frag, context):
583 src = context.get_config(b"src")
584 graphscope.declare(graphscope.Vertex, source)
585 native_source = False
586 v_label_num = frag.vertex_label_num()
587 for v_label_id in range(v_label_num):
588 if frag.get_inner_node(v_label_id, src, source):
589 native_source = True
590 break
591 if native_source:
592 context.set_node_value(source, 0)
593 else:
594 return
595 e_label_num = frag.edge_label_num()
596 for e_label_id in range(e_label_num):
597 edges = frag.get_outgoing_edges(source, e_label_id)
598 for e in edges:
599 dst = e.neighbor()
600 distv = e.get_int(2)
601 if context.get_node_value(dst) > distv:
602 context.set_node_value(dst, distv)
603
604 @staticmethod
605 def IncEval(frag, context):

Callers

nothing calls this directly

Calls 9

get_inner_nodeMethod · 0.80
set_node_valueMethod · 0.80
get_node_valueMethod · 0.80
neighborMethod · 0.65
get_configMethod · 0.45
vertex_label_numMethod · 0.45
edge_label_numMethod · 0.45
get_outgoing_edgesMethod · 0.45
get_intMethod · 0.45

Tested by

no test coverage detected