Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    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))
Example #4
0
    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))
Example #5
0
 def test_args(self):
     arg = ArgPack(1, 2, 3)
     self.assertEqual(len(arg), 3)