async def test_eval_start(self):
     try:
         async_session = WolframLanguageAsyncSession(
             kernel_path, kernel_loglevel=logging.INFO)
         res = await async_session.evaluate(wl.Plus(1, 1))
         self.assertTrue(res, 2)
     finally:
         if async_session:
             await async_session.terminate()
Esempio n. 2
0
 def _(blk):
     blk.AllIDs = wl.Keys(serv.existingAccounts)
     blk.id = wl.ToString(
         If(
             wl.Not(wl.SameQ(wl.Length(blk.AllIDs), 0)),
             wl.Plus(wl.Max(wl.Map(wlexpr('ToExpression'), blk.AllIDs)),
                     1), 1))
     blk.existingAccounts[blk.id] = blk.dataUser
     blk.save_json(blk.coID, blk.existingAccounts)
     blk.accountData[blk.id] = wl.Association()
     blk.save_json(blk.coDATA, blk.accountData)
 def test_evaluate_basic_wl(self):
     res = self.kernel_session.evaluate(wl.Plus(1, 2))
     self.assertEqual(res, 3)
 def test_evaluate_async_basic_wl(self):
     future = self.kernel_session.evaluate_future(wl.Plus(1, 2))
     self.assertEqual(future.result(timeout=2), 3)