Ejemplo n.º 1
0
 def setUpClass(cls):
     state.update({
         'resource_paths':
         os.path.join(os.path.dirname(os.path.abspath(__file__)),
                      "../static")
     })
     cls.execution_path = os.path.dirname(os.path.abspath(__file__))
     cls.project = Project(os.path.join(cls.execution_path, "test_vasp"))
     cls.job = cls.project.create_job("Vasp", "trial")
     cls.job_spin = cls.project.create_job("Vasp", "spin")
     cls.job_spin.structure = CrystalStructure("Fe",
                                               BravaisBasis="bcc",
                                               a=2.83)
     cls.job_spin.structure = cls.job_spin.structure.repeat(2)
     cls.job_spin.structure[2] = "Se"
     cls.job_spin.structure[3] = "O"
     cls.job_metadyn = cls.project.create_job("VaspMetadyn",
                                              "trial_metadyn")
     cls.job_complete = Vasp(
         project=ProjectHDFio(project=cls.project,
                              file_name="vasp_complete"),
         job_name="vasp_complete",
     )
     poscar_file = posixpath.join(
         cls.execution_path,
         "../static/vasp_test_files/full_job_sample/POSCAR")
     cls.job_complete.structure = read_atoms(poscar_file,
                                             species_from_potcar=True)
     poscar_file = posixpath.join(
         cls.execution_path,
         "../static/vasp_test_files/poscar_samples/POSCAR_metadyn")
     cls.job_metadyn.structure = read_atoms(poscar_file)
Ejemplo n.º 2
0
 def test_deleted_jobs_jobstatus(self):
     state.update(config_dict={"disable_database": True})
     job = self.project.create.job.ScriptJob("test")
     job.script_path = __file__
     job.server.run_mode.manual = True
     job.run()
     os.remove(job.project_hdf5.file_name)
     df = self.project.job_table()
     self.assertEqual(len(df), 1)
     self.assertEqual(df.status.values[0], None)
Ejemplo n.º 3
0
 def tearDownClass(cls):
     cls.execution_path = os.path.dirname(os.path.abspath(__file__))
     project = Project(os.path.join(cls.execution_path, "test_calphy"))
     project.remove_jobs(silently=True, recursive=True)
     project.remove(enable=True)
     filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                             "../static/")
     out_project = Project(os.path.join(filepath, "test_files"))
     out_project.remove_jobs(silently=True, recursive=True)
     out_project.remove(enable=True)
     state.update()
Ejemplo n.º 4
0
 def setUpClass(cls):
     state.update({
         "resource_paths":
         os.path.join(os.path.dirname(os.path.abspath(__file__)),
                      "../static/calphy_test_files")
     })
     cls.execution_path = os.path.dirname(os.path.abspath(__file__))
     # cls.file_location = os.path.dirname(os.path.abspath(__file__))
     cls.project = Project(os.path.join(cls.execution_path, "test_calphy"))
     cls.job = Calphy(
         project=ProjectHDFio(project=cls.project, file_name="test_calphy"),
         job_name="test_calphy",
     )
     filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                             "../static/")
     cls.output_project = Project(os.path.join(filepath, "test_files"))
Ejemplo n.º 5
0
 def tearDownClass(cls) -> None:
     state.update()
Ejemplo n.º 6
0
 def setUpClass(cls):
     state.update({
         'resource_paths':
         os.path.join(os.path.dirname(os.path.abspath(__file__)),
                      "../../static")
     })
Ejemplo n.º 7
0
 def tearDownClass(cls):
     state.update()
     super().tearDownClass()
Ejemplo n.º 8
0
 def setUpClass(cls):
     super().setUpClass()
     state.update(config_dict={"disable_database": True})
Ejemplo n.º 9
0
 def tearDownClass(cls):
     cls.execution_path = os.path.dirname(os.path.abspath(__file__))
     project = Project(os.path.join(cls.execution_path, "test_vasp"))
     project.remove_jobs_silently(recursive=True)
     project.remove(enable=True)
     state.update()
Ejemplo n.º 10
0
 def setUpClass(cls):
     super().setUpClass()
     cls.execution_path = os.path.dirname(os.path.abspath(__file__))
     state.update({'resource_paths': os.path.join(os.path.dirname(os.path.abspath(__file__)), "../static")})