cwd

atomate2.aims.utils.common.cwd(path, mkdir=False, rmdir=False)[source]

Change cwd intermediately.

Example

>>> with cwd(some_path):
>>>     do so some stuff in some_path
>>> do so some other stuff in old cwd
Parameters:
  • path (str or Path) – Path to change working directory to

  • mkdir (bool) – If True make path if it does not exist

  • rmdir (bool) – If True remove the working directory upon exiting

Return type:

Generator