def test_append_ptr(self): arg = ArgPack(StringList()) self.assertEqual(len(arg), 1) func = getattr(TEST_LIB, "test_argpack_is_stringlist") func.restype = None func.argtypes = [ArgPack] func(arg)
def test_create(self): arg = ArgPack() self.assertEqual(len(arg), 0) arg.append(StringList()) self.assertEqual(len(arg), 1) arg.append(3.14) self.assertEqual(len(arg), 2) o = object() with self.assertRaises(TypeError): arg.append(o)
def addSimulation(self, iens, target_fs): if iens >= self._size: raise UserWarning("Realization number out of range: %d >= %d" % (iens, self._size)) if iens in self._run_args: raise UserWarning("Realization number: '%d' already queued" % iens) run_arg = RunArg.createEnsembleExperimentRunArg( target_fs, iens, self._runpath_list[iens]) self._run_args[iens] = run_arg self._thread_pool.submitJob(ArgPack(self._ert, run_arg))
def addSimulation(self, iens, target_fs): if iens >= self._size: raise UserWarning("Realization number out of range: %d >= %d" % (iens, self._size)) if iens in self._run_args: raise UserWarning("Realization number: '%d' already queued" % iens) runpath_fmt = self._ert.getModelConfig().getRunpathFormat() member = self._ert.getRealisation(iens) runpath = ErtRunContext.createRunpath(iens , runpath_fmt, member.getDataKW( )) run_arg = RunArg.createEnsembleExperimentRunArg(target_fs, iens, runpath) self._ert.createRunPath(run_arg) self._run_args[iens] = run_arg self._thread_pool.submitJob(ArgPack(self._ert, run_arg))
def test_args(self): arg = ArgPack(1, 2, 3) self.assertEqual(len(arg), 3)