Skip to content

Commit

Permalink
fix cwd patch in newer ASE version (#318)
Browse files Browse the repository at this point in the history
* fix cwd patch in newer ASE version

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
PythonFZ and pre-commit-ci[bot] committed Jul 25, 2024
1 parent 727202f commit bd71d3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ipsuite/calculators/cp2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _update_paths(cp2k_input_dict) -> dict:
)


def _update_cmd(cp2k_cmd: str, env="IPSUITE_CP2K_SHELL") -> str:
def _update_cmd(cp2k_cmd: str | None, env="IPSUITE_CP2K_SHELL") -> str:
"""Update the shell command to run cp2k."""
if cp2k_cmd is None:
# Load from environment variable IPSUITE_CP2K_SHELL
Expand Down Expand Up @@ -259,7 +259,7 @@ def get_calculator(self, directory: str = None):
shutil.copy(restart_wfn, directory / "cp2k-RESTART.wfn")

patch(
"ase.calculators.cp2k.Popen",
"ase.calculators.cp2k.subprocess.Popen",
wraps=functools.partial(subprocess.Popen, cwd=directory),
).start()

Expand Down

0 comments on commit bd71d3f

Please sign in to comment.