Esempio n. 1
0
    def find_class(self, name):
        from aiida.work.legacy.job_process import JobProcess

        if self.is_wrapped_job_calculation(name):
            idx = name.find(JobProcess.__name__)
            wrapped_class = name[idx + len(JobProcess.__name__) + 1:]
            # Recreate the class
            return JobProcess.build(plum.util.load_class(wrapped_class))
Esempio n. 2
0
    def test_class_loader(self):
        TemplatereplacerProcess = JobProcess.build(TemplatereplacerCalculation)
        LoadedClass = class_loader.load_class(
            fullname(TemplatereplacerProcess))

        self.assertEqual(TemplatereplacerProcess.__name__,
                         LoadedClass.__name__)
        self.assertEqual(fullname(TemplatereplacerProcess),
                         fullname(LoadedClass))
Esempio n. 3
0
    def test_class_loader(self):
        PwProcess = JobProcess.build(PwCalculation)
        LoadedClass = class_loader.load_class(fullname(PwProcess))

        self.assertEqual(PwProcess.__name__, LoadedClass.__name__)
        self.assertEqual(fullname(PwProcess), fullname(LoadedClass))
Esempio n. 4
0
 def test_class_loader(self):
     cl = ClassLoader()
     PwProcess = JobProcess.build(PwCalculation)
Esempio n. 5
0
 def test_class_loader(self):
     cl = ClassLoader()
     TemplatereplacerProcess = JobProcess.build(TemplatereplacerCalculation)