tfep.utils.misc.temporary_cd

tfep.utils.misc.temporary_cd(dir_path)[source]

Context manager that temporarily sets the working directory.

Parameters:

dir_path (str or None) – The path to the temporary working directory. If None, the working directory is not changed. This might be useful to avoid branching code.