aces.operations.directory

Holds bespoke operations related to directories

Module Contents

Functions

setup_chdir_workdir(→ pathlib.Path)

Perform checks on the target working directory. If it does not exist

check_create_dir(→ pathlib.Path)

Check and if necessary create a directory

Attributes

logger

aces.operations.directory.logger[source]
aces.operations.directory.setup_chdir_workdir(workdir: pathlib.Path | str | None = None) pathlib.Path[source]

Perform checks on the target working directory. If it does not exist it will be created, and execution will be switched to take placce in the target

Args:

workdir (Optional[Union[Path,str]], optional): Location where work will be carried out. If None the current working directory is used. Defaults to None.

Returns:

Path: The resolved working directory

aces.operations.directory.check_create_dir(target_dir: pathlib.Path) pathlib.Path[source]

Check and if necessary create a directory

Args:

target_dir (Path): Path to ensure if it is a directory, and create it if it does not exist

Returns:

Path: Path to directory