Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP2KSinglePoint: support for dftb #291

Open
PythonFZ opened this issue Apr 23, 2024 · 0 comments
Open

CP2KSinglePoint: support for dftb #291

PythonFZ opened this issue Apr 23, 2024 · 0 comments

Comments

@PythonFZ
Copy link
Member

Needs something like

def _update_paths(cp2k_input_dict) -> dict:
    try:
        cp2k_input_dict["force_eval"]["DFT"]["basis_set_file_name"] = (
            pathlib.Path(cp2k_input_dict["force_eval"]["DFT"]["basis_set_file_name"])
            .resolve()
            .as_posix()
        )
    except KeyError:
        pass
    
    try:
        cp2k_input_dict["force_eval"]["DFT"]["potential_file_name"] = (
            pathlib.Path(cp2k_input_dict["force_eval"]["DFT"]["potential_file_name"])
            .resolve()
            .as_posix()
        )
    except KeyError:
        pass

    try:
        cp2k_input_dict["force_eval"]["DFT"]["QS"]["dftb"]["parameter"]["param_file_path"] = (
            pathlib.Path(cp2k_input_dict["force_eval"]["DFT"]["QS"]["dftb"]["parameter"]["param_file_path"])
            .resolve()
            .as_posix()
        )
    except KeyError:
        pass

    try:
        cp2k_input_dict["force_eval"]["DFT"]["QS"]["dftb"]["parameter"]["dispersion_parameter_file"] = (
            pathlib.Path(cp2k_input_dict["force_eval"]["DFT"]["QS"]["dftb"]["parameter"]["dispersion_parameter_file"])
            .resolve()
            .as_posix()
        )
    except KeyError:
        pass

maybe there is a more generic way to resolve all file paths using Path.exist method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant