pydoit_nb.config_helpers#
Helper functions that can be useful when setting up config
assert_path_exists#
- assert_path_exists(inp)[source]#
Assert that a path exists
- Parameters:
inp (
pathlib.Path) – Path to check- Raises:
FileNotFoundError –
inpdoes not exist- Return type:
assert_path_is_absolute#
- assert_path_is_absolute(inp)[source]#
Assert that a path is an absolute path
- Parameters:
inp (
pathlib.Path) – Path to check- Raises:
AssertionError –
inpis not absolute- Return type:
assert_step_config_ids_are_unique#
- assert_step_config_ids_are_unique(inp)[source]#
Assert that all the
step_config_idin a collection are unique- Parameters:
inp (
collections.abc.Collection[pydoit_nb.typing.NotebookConfigLike]) – Collection ofNotebookConfigLikeobjects to check.- Raises:
AssertionError – The
step_config_idof eachNotebookConfigLikeare not unique.- Return type:
assert_path_is_subdirectory_of_root_dir_output#
- assert_path_is_subdirectory_of_root_dir_output(instance, attribute, value)[source]#
Assert that a path is a sub-directory of
instance.root_dir_output- Parameters:
instance – Instance to check
attribute – Attribute that is being set
value – Value that is being used to set the attribute
- Raises:
AssertionError –
valueis not a sub-directory ofinstance.root_dir_output