MCPcopy
hub / github.com/facebookresearch/nevergrad / test_sequential_executor

Function test_sequential_executor

nevergrad/optimization/test_utils.py:33–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32
33def test_sequential_executor() -> None:
34 func = CounterFunction()
35 executor = utils.SequentialExecutor()
36 job1 = executor.submit(func, [3])
37 np.testing.assert_equal(job1.done(), True)
38 np.testing.assert_equal(job1.result(), 4)
39 np.testing.assert_equal(func.count, 1)
40 job2 = executor.submit(func, [3])
41 np.testing.assert_equal(job2.done(), True)
42 np.testing.assert_equal(func.count, 1) # not computed just yet
43 job2.result()
44 np.testing.assert_equal(func.count, 2)
45
46
47def test_get_nash() -> None:

Callers

nothing calls this directly

Calls 4

submitMethod · 0.95
CounterFunctionClass · 0.85
doneMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…