Skip to content

Commit

Permalink
Running work flow
Browse files Browse the repository at this point in the history
Next steps:

- refactor stuff around get_notebook_branch_tasks
    - this needs to handle things such that each notebook is returned as a base task and then notebooks combined with steps are returned as sub-tasks of that base task (this makes doit list render correctly)
    - would make sense to put notebook name at the front base task too so it is easier to identify where things have come from and the tasks sort in order of the notebooks when listed

- get `make checks` to pass
- fix up README
- ask Jared for review
  • Loading branch information
znichollscr committed Nov 6, 2023
1 parent 969d1c9 commit 95b45ae
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ all-debug: ## compile all outputs, falling to debugger on failure
poetry run doit run --pdb

doit-list: ## list all the doit tasks
poetry run doit list
poetry run doit list --all

$(DEV_CONFIG_ABSOLUTE_YAML): $(DEV_CONFIG_YAML) scripts/create-dev-config-absolute.py
poetry run python scripts/create-dev-config-absolute.py
Expand Down
12 changes: 11 additions & 1 deletion src/local/notebook_steps/figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ def get_figures_notebook_steps(
)
notebook_output_dir.mkdir(exist_ok=True, parents=True)

# TODO: refactor this
notebook_base_tasks = [
{
"basename": nb.summary,
"name": None,
"doc": nb.doc,
}
for nb in figures_notebooks
]

steps = [
NotebookStep.from_unconfigured_notebook(
unconfigured=nb,
Expand All @@ -72,4 +82,4 @@ def get_figures_notebook_steps(
for nb in figures_notebooks
]

return steps
return notebook_base_tasks, steps
2 changes: 1 addition & 1 deletion src/local/pydoit_nb/notebook_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def to_doit_task(
task = dict(
basename=self.summary_notebook,
name=self.branch_config_id,
doc=f"{self.doc_notebook} for config {self.branch_config_id}",
doc=f"{self.doc_notebook}. branch_config_id={self.branch_config_id!r}",
actions=[
(
run_notebook,
Expand Down
8 changes: 8 additions & 0 deletions src/local/pydoit_nb/tasks_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,13 @@ def get_notebook_branch_tasks( # noqa: PLR0913
root_dir_raw_notebooks=root_dir_raw_notebooks,
)

# TODO: refactor this
if isinstance(steps, tuple):
base_tasks = steps[0]
steps = steps[1]

for bt in base_tasks:
yield bt

for step in steps:
yield step.to_doit_task(converter=converter, clean=clean)

0 comments on commit 95b45ae

Please sign in to comment.