Beispiel #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))
Beispiel #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))
Beispiel #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))
Beispiel #4
0
 def test_class_loader(self):
     cl = ClassLoader()
     PwProcess = JobProcess.build(PwCalculation)
Beispiel #5
0
 def test_class_loader(self):
     cl = ClassLoader()
     TemplatereplacerProcess = JobProcess.build(TemplatereplacerCalculation)