Skip to content

Commit 634eefe

Browse files
committed
Fix docs.
1 parent ded307e commit 634eefe

7 files changed

Lines changed: 45 additions & 72 deletions

File tree

docs/source/_static/md/pdb.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0
88
Root: C:\Users\pytask-dev\git\my_project
99
Collected 1 task.
1010

11-
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
11+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1212
<span style="color: #f14c4c">╭───────────────────</span><span style="color: #f14c4c; font-weight: bold;"> Traceback </span><span style="color: #6c1e1e; font-weight: bold">(most recent call last)</span><span style="color: #f14c4c"> ─────────────────╮</span>
1313
<span style="color: #f14c4c">│</span> <span style="color: #f14c4c">│</span>
1414
<span style="color: #f14c4c">│</span> <span style="color: #e5e510">.../task_data_preparation.py</span>:<span style="color: var(--termynal-blue)">23</span> in <span style="color: #23d18b">task_create_random_data</span> <span style="color: #f14c4c">│</span>
@@ -24,7 +24,7 @@ Collected 1 task.
2424
<span style="color: #f14c4c; font-weight: bold;">Exception</span>
2525

2626
>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>
27-
> ...\git\my_project\task_data_preparation.py(23)task_create_random_data()
27+
> ...\my_project\task_data_preparation.py(23)task_create_random_data()
2828
-> raise Exception
2929
<span data-ty="input" data-ty-prompt="(Pdb)" data-ty-cursor="▋"></span>
3030

docs/source/_static/md/show-locals.md

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

docs/source/_static/md/trace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0
88
Root: C:\Users\pytask-dev\git\my_project
99
Collected 1 task.
1010

11-
>>>>>>>>>>>>>>>> PDB runcall (IO-capturing turned off) >>>>>>>>>>>>>>>
11+
>>>>>>>>>>>>>>>>>> PDB runcall (IO-capturing turned off) >>>>>>>>>>>>>>>>
1212

13-
> ...\git\my_project\task_create_random_data.py(13)task_create_random_data()
13+
> ...\my_project\task_create_random_data.py(13)task_create_random_data()
1414
-> rng = np.random.default_rng(0)
1515
<span data-ty="input" data-ty-prompt="(Pdb)" data-ty-cursor="▋"></span>
1616

docs/source/how_to_guides/capture_warnings.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,5 @@ and then run `pytask`.
8787
Or, you use a temporary environment variable. Here is an example for bash.
8888

8989
```console
90-
PYTHONWARNINGS=error pytask --pdb
91-
```
92-
93-
and here for Powershell
94-
95-
```console
96-
$env:PYTHONWARNINGS = 'error'
97-
pytask
98-
Remove-Item env:\PYTHONWARNINGS
90+
$ PYTHONWARNINGS=error pytask --pdb
9991
```

docs/source/how_to_guides/hashing_inputs_of_tasks.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,19 @@ If an input is not parsed by any more specific node type, the general
1111
In the following example, the argument `text` will be parsed as a
1212
{class}`~pytask.PythonNode`.
1313

14-
`````{tab-set}
15-
16-
````{tab-item} Python 3.10+
17-
1814
```{literalinclude} ../../../docs_src/how_to_guides/hashing_inputs_of_tasks_example_1_py310.py
1915
```
2016

21-
````
22-
`````
23-
2417
By default, pytask does not detect changes in {class}`~pytask.PythonNode` and if the
2518
value would change (without changing the task module), pytask would not rerun the task.
2619

2720
We can also hash the value of {class}`~pytask.PythonNode` s so that pytask knows when
2821
the input changed. For that, we need to use the {class}`~pytask.PythonNode` explicitly
2922
and set `hash = True`.
3023

31-
`````{tab-set}
32-
33-
````{tab-item} Python 3.10+
34-
3524
```{literalinclude} ../../../docs_src/how_to_guides/hashing_inputs_of_tasks_example_2_py310.py
3625
```
3726

38-
````
39-
`````
40-
4127
When `hash=True`, pytask will call the builtin {func}`hash` on the input that will call
4228
the `__hash__()` method of the object.
4329

@@ -75,12 +61,5 @@ $ conda install deepdiff
7561
Then, create the hash function and pass it to the node. Make sure it returns either an
7662
integer or a string.
7763

78-
`````{tab-set}
79-
80-
````{tab-item} Python 3.10+
81-
8264
```{literalinclude} ../../../docs_src/how_to_guides/hashing_inputs_of_tasks_example_3_py310.py
8365
```
84-
85-
````
86-
`````

docs/source/how_to_guides/provisional_nodes_and_task_generators.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ as the task module because it is a relative path.
2525

2626
```{literalinclude} ../../../docs_src/how_to_guides/provisional_products.py
2727
---
28-
emphasize-lines: 4, 22
28+
emphasize-lines: 6, 23
2929
---
3030
```
3131

@@ -57,7 +57,7 @@ downloaded.
5757

5858
```{literalinclude} ../../../docs_src/how_to_guides/provisional_task.py
5959
---
60-
emphasize-lines: 9
60+
emphasize-lines: 4, 9
6161
---
6262
```
6363

@@ -86,6 +86,9 @@ The code snippet shows each task takes one of the downloaded files and copies it
8686
content to a `.txt` file.
8787

8888
```{literalinclude} ../../../docs_src/how_to_guides/provisional_task_generator.py
89+
---
90+
emphasize-lines: 4, 11
91+
---
8992
```
9093

9194
```{important}

docs/source/tutorials/selecting_tasks.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,12 @@ This command only runs the first two tasks.
7070
$ pytask -k "1 or 2 and not 12"
7171
```
7272

73-
To execute a single task, say `task_run_this_one` in `task_example.py`, use
73+
To execute a single task, say `task_run_this_one` in `task_example.py`, use one of the
74+
following commands.
7475

7576
```console
7677
$ pytask -k task_example.py::task_run_this_one
7778

78-
# or
79-
8079
$ pytask -k task_run_this_one
8180
```
8281

0 commit comments

Comments
 (0)