openff.bespokefit.utilities.tempcd.temporary_cd

openff.bespokefit.utilities.tempcd.temporary_cd(path: Optional[Union[str, Path]] = None)[source]

Context manager to move the current working directory to the path specified.

If no path is given or the path does not exist, a temporary directory will be created. This temporary directory and its contents will be deleted when the context manager exits.

Parameters

path – The path to CD into. If None or not specified, a temporary directory will be created. If specified but the path does not exist, a temporary directory with that name will be created.