Ejemplo n.º 1
0
    def _single_lobster_db_insertion(self, fake=True):
        structure = self.struct_mp
        my_wf = get_wf_lobster_test_basis(
            structure=structure,
            c={
                "vasp_cmd": VASP_CMD,
                "DB_FILE": DB_FILE
            },
            user_kpoints_settings={"grid_density": 100},
            delete_all_wavecars=False)

        if fake:
            my_wf = use_fake_vasp(my_wf, ref_dirs=refs_dirs_complex_vasp)
            my_wf = use_fake_lobster(my_wf, ref_dirs=refs_dirs_complex_lobster)
        else:
            my_wf = use_custodian(my_wf)

        self.lp.add_wf(my_wf)

        # run the workflow
        rapidfire(self.lp)
        d = self.get_task_collection(coll_name="lobster").find_one(
            filter={"basis_id": 1})
        self._check_run(d, mode="lobsternormal")

        wf = self.lp.get_wf_by_fw_id(1)
        self.assertTrue(all([s == 'COMPLETED' for s in wf.fw_states.values()]))
Ejemplo n.º 2
0
    def _single_vasp_lobster(self,
                             delete_wavecars=False,
                             user_supplied_basis=None,
                             fake=True):
        # add the workflow
        structure = self.struct_si
        my_wf = get_wf_lobster(structure=structure,
                               c={
                                   "vasp_cmd": VASP_CMD,
                                   "DB_FILE": None
                               },
                               user_kpoints_settings={"grid_density": 100},
                               delete_all_wavecars=delete_wavecars,
                               user_supplied_basis=user_supplied_basis)
        if fake:
            my_wf = use_fake_vasp(my_wf, refs_dirs_si_vasp)
            my_wf = use_fake_lobster(my_wf, refs_dirs_si_lobster)
        else:
            my_wf = use_custodian(my_wf)

        self.lp.add_wf(my_wf)

        # run the workflow
        rapidfire(self.lp)

        fw = self.lp.get_fw_by_id(fw_id=1)
        with open(os.path.join(fw.launches[-1].launch_dir,
                               "task_lobster.json")) as f:
            d = json.load(f)
        self._check_run(d, mode="lobsternormal", database=False)

        wf = self.lp.get_wf_by_fw_id(1)
        self.assertTrue(all([s == 'COMPLETED' for s in wf.fw_states.values()]))
Ejemplo n.º 3
0
    def _single_lobster_db_insertion(self,
                                     delete_wavecars=False,
                                     user_supplied_basis=None,
                                     fake=True):

        structure = self.struct_si
        my_wf = get_wf_lobster(structure=structure,
                               c={
                                   "vasp_cmd": VASP_CMD,
                                   "DB_FILE": DB_FILE
                               },
                               user_kpoints_settings={"grid_density": 100},
                               delete_all_wavecars=delete_wavecars,
                               user_supplied_basis=user_supplied_basis,
                               additional_outputs=["ICOOPLIST.lobster"])
        if fake:
            my_wf = use_fake_vasp(my_wf, refs_dirs_si_vasp)
            my_wf = use_fake_lobster(my_wf, refs_dirs_si_lobster)
        else:
            my_wf = use_custodian(my_wf)

        self.lp.add_wf(my_wf)

        # run the workflow
        rapidfire(self.lp)
        d = self.get_task_collection(coll_name="lobster").find_one()
        if delete_wavecars:
            self._check_run(d, mode="lobsternormal_delete_wavecars")
        else:
            self._check_run(d, mode="lobsternormal")

        wf = self.lp.get_wf_by_fw_id(1)
        self.assertTrue(all([s == 'COMPLETED' for s in wf.fw_states.values()]))