Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
`attributes` field on `PNode` and `PProvisionalNode` that will be mandatory on custom
nodes in v0.6.0.
- {pull}`662` adds the `.pixi` folder to be ignored by default during the collection.
- {pull}`671` enhances the documentation on complex repetitions. Closes {issue}`670`.

## 0.5.2 - 2024-12-19

Expand Down
3 changes: 3 additions & 0 deletions docs/source/how_to_guides/bp_complex_task_repetitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ caption: task_example.py
As you see, we lost a level of indentation and we moved all the generations of names and
paths to the dimensions and multi-dimensional objects.

Using a {class}`~pytask.PythonNode` allows us to hash the model and reexecute the task
if we define other model settings.

## Adding another level

Extending a dimension by another level is usually quickly done. For example, if we have
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
from pathlib import Path
from typing import Annotated
from typing import Any

from myproject.config import EXPERIMENTS
from myproject.config import Model
from myproject.config import data_catalog

from _pytask.nodes import PythonNode
from pytask import task

for experiment in EXPERIMENTS:

@task(id=experiment.name)
def task_fit_model(
path_to_data: experiment.dataset.path,
model: Annotated[Model, PythonNode(hash=True)] = experiment.model,
path_to_data: Path = experiment.dataset.path,
) -> Annotated[Any, data_catalog[experiment.fitted_model_name]]: ...
37 changes: 0 additions & 37 deletions docs_src/how_to_guides/bp_complex_task_repetitions/experiment.py

This file was deleted.