Skip to content

Commit 9b8cea1

Browse files
committed
Merge remote-tracking branch 'origin/fix-from-pytask-import-mark' into fix-from-pytask-import-mark
2 parents d3c6d92 + 986e73b commit 9b8cea1

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

docs/source/reference_guides/api.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ For example:
177177

178178
```python
179179
@pytask.mark.timeout(10, "slow", method="thread")
180-
def task_function():
181-
...
180+
def task_function(): ...
182181
```
183182

184183
Will create and attach a {class}`Mark <pytask.Mark>` object to the collected
@@ -195,8 +194,7 @@ Example for using multiple custom markers:
195194
```python
196195
@pytask.mark.timeout(10, "slow", method="thread")
197196
@pytask.mark.slow
198-
def task_function():
199-
...
197+
def task_function(): ...
200198
```
201199

202200
### Classes

docs/source/tutorials/repeating_tasks_with_different_inputs.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,7 @@ the {func}`@task <pytask.task>` decorator to pass keyword arguments to the task.
328328
for id_, kwargs in ID_TO_KWARGS.items():
329329

330330
@task(id=id_, kwargs=kwargs)
331-
def task_create_random_data(seed, produces):
332-
...
331+
def task_create_random_data(seed, produces): ...
333332
```
334333

335334
Writing a function that creates `ID_TO_KWARGS` would be even more pythonic.
@@ -349,8 +348,7 @@ ID_TO_KWARGS = create_parametrization()
349348
for id_, kwargs in ID_TO_KWARGS.items():
350349

351350
@task(id=id_, kwargs=kwargs)
352-
def task_create_random_data(i, produces):
353-
...
351+
def task_create_random_data(i, produces): ...
354352
```
355353

356354
The {doc}`best-practices guide on parametrizations <../how_to_guides/bp_scaling_tasks>`

docs/source/tutorials/selecting_tasks.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ from pytask import task
9191
for i in range(2):
9292

9393
@task
94-
def task_parametrized(i=i):
95-
...
94+
def task_parametrized(i=i): ...
9695
```
9796

9897
To run the task where `i = 1`, run this command.

docs/source/tutorials/skipping_tasks.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ from config import NO_LONG_RUNNING_TASKS
4242

4343

4444
@pytask.mark.skipif(NO_LONG_RUNNING_TASKS, reason="Skip long-running tasks.")
45-
def task_that_takes_really_long_to_run(path: Path = Path("time_intensive_product.pkl")):
46-
...
45+
def task_that_takes_really_long_to_run(
46+
path: Path = Path("time_intensive_product.pkl"),
47+
): ...
4748
```
4849

4950
## Further reading

docs/source/tutorials/write_a_task.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,14 @@ from pytask import task
136136

137137

138138
@task
139-
def create_random_data():
140-
...
139+
def create_random_data(): ...
141140

142141

143142
# The id will be ".../task_data_preparation.py::create_data".
144143

145144

146145
@task(name="create_data")
147-
def create_random_data():
148-
...
146+
def create_random_data(): ...
149147
```
150148

151149
```{warning}

0 commit comments

Comments
 (0)