pydoit_nb.notebook#
Notebook defining classes
UnconfiguredNotebook#
- class UnconfiguredNotebook(notebook_path, raw_notebook_ext, summary, doc)[source]#
Bases:
objectA notebook without any configuration
-
notebook_path:
pathlib.Path# Path to notebook, relative to the raw notebook directory
-
notebook_path:
ConfiguredNotebook#
- class ConfiguredNotebook(unconfigured_notebook, dependencies, targets, config_file, step_config_id, configuration=None)[source]#
Bases:
objectA configured notebook
It might make sense to refactor this so has an UnconfiguredNotebook as one of its attributes rather than duplicatinng things. That would probably also make it clearer that a configured notebook is just the combination of an unconfigured notebook and the config we want to use with it.
-
config_file:
pathlib.Path# Path to the config file to use with the notebook
-
configuration:
typing.Optional[tuple[typing.Any,...]]# Configuration used by the notebook.
If any of the configuration changes then the notebook will be triggered.
If nothing is provided, then the notebook will be run whenever the configuration file driving the notebook is modified (i.e. the notebook will be re-run for any configuration change).
-
dependencies:
tuple[pathlib.Path,...]# Paths on which the notebook depends
-
targets:
tuple[pathlib.Path,...]# Paths which the notebook creates/controls
- to_doit_task(root_dir_raw_notebooks, notebook_output_dir, base_task, converter=None, clean=True, config_changed_class=<class 'doit.tools.config_changed'>)[source]#
Convert to a
doittask- Parameters:
root_dir_raw_notebooks (
pathlib.Path) – Root directory in which the raw (not yet run) notebooks are keptnotebook_output_dir (
pathlib.Path) – Directory in which to write out the run notebookbase_task (
dict[str,typing.Any]) – Base task definition for this notebook stepconverter (
typing.Optional[pydoit_nb.typing.Converter]) – Converter to use to serialise configuration if needed.clean (
bool) – If we run doit clean, should the targets also be removed?config_changed_class (
typing.Any) – Class to use for creating our object which can identify if config has changed or not. This should only need to be changed in very rare circumstances. The type hint is very vague because we don’t want to repeat the pydoit API/logic here.
- Returns:
dict[str,typing.Any] – Task specification for use withdoit- Raises:
TypeError –
self.configuration is not Nonebutconverter is None
-
unconfigured_notebook:
pydoit_nb.notebook.UnconfiguredNotebook# The unconfigured notebook which should be combined with the configuration
-
config_file: