Пример #1
0
 def setUp(self):
     super(TestProcessBuilder, self).setUp()
     self.assertIsNone(Process.current())
     self.calculation_class = CalculationFactory(
         'simpleplugins.templatereplacer')
     self.process_class = self.calculation_class.process()
     self.builder = self.process_class.get_builder()
Пример #2
0
def run_eos_wf(codename, pseudo_family, element):
    print "Workfunction node identifiers: {}".format(Process.current().calc)
    s0 = create_diamond_fcc(Str(element))

    calcs = {}
    for label, factor in zip(labels, scale_facs):
        s = rescale(s0, Float(factor))
        inputs = generate_scf_input_params(s, str(codename),
                                           Str(pseudo_family))
        print "Running a scf for {} with scale factor {}".format(
            element, factor)
        result = run(PwCalculation, **inputs)
        print "RESULT: {}".format(result)
        calcs[label] = get_info(result)

    eos = []
    for label in labels:
        eos.append(calcs[label])

    # Return information to plot the EOS
    ParameterData = DataFactory('parameter')
    retdict = {
        'initial_structure': s0,
        'result': ParameterData(dict={'eos_data': eos})
    }

    return retdict
Пример #3
0
    def setUp(self):
        super(TestWf, self).setUp()
        self.assertIsNone(Process.current())

        @workfunction
        def wf_return_input(inp):
            return {'result': inp}

        @workfunction
        def wf_return_true():
            return get_true_node()

        @workfunction
        def wf_args(a):
            return a

        @workfunction
        def wf_args_with_default(a=Int(DEFAULT_INT)):
            return a

        @workfunction
        def wf_kwargs(**kwargs):
            return kwargs

        @workfunction
        def wf_args_and_kwargs(a, **kwargs):
            result = {'a': a}
            result.update(kwargs)
            return result

        @workfunction
        def wf_args_and_default(a, b=Int(DEFAULT_INT)):
            return {'a': a, 'b': b}

        @workfunction
        def wf_default_label_description(a=Int(DEFAULT_INT),
                                         label=DEFAULT_LABEL,
                                         description=DEFAULT_DESCRIPTION):
            return a

        @workfunction
        def wf_exit_code(exit_status, exit_message):
            return ExitCode(exit_status.value, exit_message.value)

        @workfunction
        def wf_excepts(exception):
            raise RuntimeError(exception.value)

        self.wf_return_input = wf_return_input
        self.wf_return_true = wf_return_true
        self.wf_args = wf_args
        self.wf_args_with_default = wf_args_with_default
        self.wf_kwargs = wf_kwargs
        self.wf_args_and_kwargs = wf_args_and_kwargs
        self.wf_args_and_default = wf_args_and_default
        self.wf_default_label_description = wf_default_label_description
        self.wf_exit_code = wf_exit_code
        self.wf_excepts = wf_excepts
Пример #4
0
 def tearDown(self):
     super(TestImmutableInputWorkchain, self).tearDown()
     work.set_runner(None)
     self.assertIsNone(Process.current())
Пример #5
0
 def setUp(self):
     super(TestImmutableInputWorkchain, self).setUp()
     self.assertIsNone(Process.current())
     self.runner = utils.create_test_runner()
Пример #6
0
 def tearDown(self):
     super(TestWorkChainAbortChildren, self).tearDown()
     work.set_runner(None)
     self.assertIsNone(Process.current())
Пример #7
0
 def setUp(self):
     super(TestWorkChainAbortChildren, self).setUp()
     self.assertIsNone(Process.current())
     self.runner = utils.create_test_runner(with_communicator=True)
Пример #8
0
 def tearDown(self):
     super(TestWorkchainWithOldWorkflows, self).tearDown()
     work.set_runner(None)
     self.runner.close()
     self.runner = None
     self.assertIsNone(Process.current())
Пример #9
0
 def setUp(self):
     super(TestProcess, self).setUp()
     work.runners.set_runner(None)
     self.assertIsNone(Process.current())
Пример #10
0
 def tearDown(self):
     super(TestSerializeWorkChain, self).tearDown()
     work.set_runner(None)
     self.assertIsNone(Process.current())
Пример #11
0
 def setUp(self):
     super(TestLaunchers, self).setUp()
     self.assertIsNone(Process.current())
     self.a = Int(1)
     self.b = Int(2)
     self.result = 3
Пример #12
0
 def tearDown(self):
     super(TestJobProcess, self).tearDown()
     self.assertIsNone(Process.current())
     self.runner.close()
     self.runner = None
     work.set_runner(None)
Пример #13
0
 def setUp(self):
     super(TestJobProcess, self).setUp()
     self.assertIsNone(Process.current())
     self.runner = utils.create_test_runner()
Пример #14
0
 def setUp(self):
     super(TestJobProcess, self).setUp()
     self.assertIsNone(Process.current())
Пример #15
0
 def setUp(self):
     super(TestSerializeWorkChain, self).setUp()
     self.assertIsNone(Process.current())
     self.runner = utils.create_test_runner()
Пример #16
0
 def tearDown(self):
     super(TestWorkChainExpose, self).tearDown()
     work.set_runner(None)
     self.runner.close()
     self.runner = None
     self.assertIsNone(Process.current())
Пример #17
0
 def setUp(self):
     super(TestProcessNamespace, self).setUp()
     self.assertIsNone(Process.current())
Пример #18
0
 def setUp(self):
     super(TestWorkchainWithOldWorkflows, self).setUp()
     self.assertIsNone(Process.current())
     self.runner = utils.create_test_runner()
Пример #19
0
 def tearDown(self):
     super(TestProcess, self).tearDown()
     self.assertIsNone(Process.current())
Пример #20
0
 def setUp(self):
     super(TestProcessSpec, self).setUp()
     self.assertIsNone(Process.current())
     self.spec = Process.spec()