def test_aync_def_function(): async def f(x): return x learner = Learner1D(f, (-1, 1)) runner = AsyncRunner(learner, trivial_goal) asyncio.get_event_loop().run_until_complete(runner.task)
def async_runner(learner, goal): runner = AsyncRunner(learner, goal, executor=SequentialExecutor()) asyncio.get_event_loop().run_until_complete(runner.task)
def test_default_executor(): learner = Learner1D(linear, (-1, 1)) runner = AsyncRunner(learner, goal=lambda l: l.npoints > 10) asyncio.get_event_loop().run_until_complete(runner.task)