Exemplo n.º 1
0
    def _overridden_incar_settings(self):
        result = deepcopy(defaults.user_incar_settings)
        result.update(self._prior_info.incar)

        if self.args.user_incar_settings:
            args = list2dict(self.args.user_incar_settings, all_incar_flags)
            result.update(args)

        return result
Exemplo n.º 2
0
    def _option_kwargs(self):
        result = deepcopy(defaults.options)
        if self._prior_info:
            result.update(self._prior_info.input_options_kwargs)

        if self.args.prev_dir:
            pi = prior_info_from_calc_dir(prev_dir_path=self.args.prev_dir,
                                          vasprun=self.args.vasprun,
                                          outcar=self.args.outcar)
            result.update(pi.input_options_kwargs)

            self._file_transfers = FileTransfers(self._file_transfer(),
                                                 path=self.args.prev_dir)

        if self.args.options:
            args = list2dict(self.args.options, assignable_option_set)
            result.update(args)
        if self.args.uniform_kpt_mode:
            result["kpt_mode"] = KpointsMode.uniform

        return result
Exemplo n.º 3
0
def test_dict2list(key_candidates):
    flattened_list = ["ENCUT", "500", "MAGMOM", "4", "4.0", "LWAVE", "F"]
    actual = list2dict(flattened_list, key_candidates)
    expected = {"ENCUT": 500, "MAGMOM": [4, 4.0], "LWAVE": False}
    assert actual == expected
Exemplo n.º 4
0
def test_fail2(key_candidates):
    flattened_list = ["ENCUT", "500", "MAGMOM"]
    with pytest.raises(ValueError):
        list2dict(flattened_list, key_candidates)
Exemplo n.º 5
0
def test_dict2list_2(key_candidates):
    flattened_list = ["EFIELD_PEAD", "0.1", "0.1", "0.1"]
    actual = list2dict(flattened_list, key_candidates)
    expected = {"EFIELD_PEAD": [0.1, 0.1, 0.1]}
    assert actual == expected