pydoit_nb.tasks_generation#
Re-usable tools for generating tasks
StepDefiningModuleLike#
- class StepDefiningModuleLike(*args, **kwargs)[source]#
Bases:
Protocol[C,CB_contra]Class that behaves like a module which defines a notebook-based step
- property step: UnconfiguredNotebookBasedStep[C, CB_contra]#
Step this module defines
generate_all_tasks#
- generate_all_tasks(config_bundle, root_dir_raw_notebooks, converter, step_defining_modules, gen_zenodo_bundle_task)[source]#
Generate all tasks in the workflow
This is a helper function for a common pattern. You can obviously do whatever you want in your own projects as there is a lot of flexibility.
- Parameters:
config_bundle (
pydoit_nb.typing.ConfigBundleLike[typing.TypeVar(C)]) – Configuration bundle to use in task generationroot_dir_raw_notebooks (
pathlib.Path) – Directory in which raw notebooks are kept.converter (
pydoit_nb.typing.Converter) – Object that can serialize the configuration bundle’s hydrated configstep_defining_modules (
collections.abc.Iterable[pydoit_nb.tasks_generation.StepDefiningModuleLike[typing.TypeVar(C),pydoit_nb.typing.ConfigBundleLike[typing.TypeVar(C)]]]) – Modules that define notebook-based stepsgen_zenodo_bundle_task (
typing.Callable[[list[dict[str,typing.Any]]],dict[str,typing.Any]]) – Callable that takes all the proceeding tasks and returns a task for generating a bundle which can be uploaded to Zenodo.
- Yields:
doittasks to run- Return type: