MCPcopy Index your code
hub / github.com/waleedka/hiddenlayer / test_parallel_fold

Method test_parallel_fold

tests/test_ge.py:241–261  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

239 self.assertEqual(g.incoming(g["c"])[0].op, "ab")
240
241 def test_parallel_fold(self):
242 g = hl.Graph()
243 a = hl.Node(uid="a", name="a", op="a")
244 b = hl.Node(uid="b", name="b", op="b")
245 c = hl.Node(uid="c", name="c", op="c")
246 d = hl.Node(uid="d", name="d", op="d")
247 e = hl.Node(uid="e", name="e", op="e")
248 g.add_node(a)
249 g.add_node(b)
250 g.add_node(c)
251 g.add_node(d)
252 g.add_node(e)
253 g.add_edge(a, b)
254 g.add_edge(b, c)
255 g.add_edge(a, d)
256 g.add_edge(c, e)
257 g.add_edge(d, e)
258
259 t = ht.Fold("((b > c) | d) > e", "bcde")
260 g = t.apply(g)
261 self.assertEqual(g.outgoing(g["a"])[0].op, "bcde")
262
263 def test_prune(self):
264 g = hl.Graph()

Callers

nothing calls this directly

Calls 4

add_nodeMethod · 0.95
add_edgeMethod · 0.95
applyMethod · 0.95
outgoingMethod · 0.95

Tested by

no test coverage detected