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:

FileNotFoundErrorinp does not exist

Return type:

None

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:

AssertionErrorinp is not absolute

Return type:

None

assert_step_config_ids_are_unique#

assert_step_config_ids_are_unique(inp)[source]#

Assert that all the step_config_id in a collection are unique

Parameters:

inp (collections.abc.Collection[pydoit_nb.typing.NotebookConfigLike]) – Collection of NotebookConfigLike objects to check.

Raises:

AssertionError – The step_config_id of each NotebookConfigLike are not unique.

Return type:

None

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:

AssertionErrorvalue is not a sub-directory of instance.root_dir_output