Skip to content

Commit 079f8f5

Browse files
committed
Simplify documentation after dropping Python 3.9 support.
- Remove redundant "Python 3.10" tabs from tutorials (14 instances) - Rename "Python 3.10+" tabs to "Annotated" for clarity - Delete obsolete py38 example files (20 files)
1 parent cb985d8 commit 079f8f5

24 files changed

Lines changed: 31 additions & 550 deletions

docs/source/tutorials/defining_dependencies_products.md

Lines changed: 10 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Define task dependencies and products to run your tasks.
44

55
Defining dependencies and products also determines task execution order.
66

7-
This tutorial offers you different interfaces. For type annotations, see the
8-
`Python 3.10+` tabs. You find a tutorial on type hints {doc}`here <../type_hints>`.
7+
This tutorial offers you different interfaces. For type annotations, see the `Annotated`
8+
tabs. You find a tutorial on type hints {doc}`here <../type_hints>`.
99

1010
If you want to avoid type annotations for now, look at the tab named `produces`.
1111

@@ -46,8 +46,8 @@ in `task_data_preparation.py`.
4646

4747
`````{tab-set}
4848
49-
````{tab-item} Python 3.10+
50-
:sync: python310plus
49+
````{tab-item} Annotated
50+
:sync: annotated
5151
5252
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_products_py310.py
5353
:emphasize-lines: 11
@@ -58,18 +58,6 @@ task has finished, pytask will check whether the file exists.
5858
5959
````
6060
61-
````{tab-item} Python 3.10
62-
:sync: python38plus
63-
64-
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_products_py38.py
65-
:emphasize-lines: 11
66-
```
67-
68-
{class}`~pytask.Product` allows marking an argument as a product. After the
69-
task has finished, pytask will check whether the file exists.
70-
71-
````
72-
7361
````{tab-item} produces
7462
:sync: produces
7563
@@ -100,8 +88,8 @@ we will define it in `task_plot_data.py`.
10088

10189
`````{tab-set}
10290
103-
````{tab-item} Python 3.10+
104-
:sync: python310plus
91+
````{tab-item} Annotated
92+
:sync: annotated
10593
10694
To specify the task relies on `data.pkl`, add the path
10795
to the function signature with any argument name (here `path_to_data`).
@@ -115,21 +103,6 @@ annotation are dependencies of the task.
115103
116104
````
117105
118-
````{tab-item} Python 3.10
119-
:sync: python38plus
120-
121-
To specify the task relies on `data.pkl`, add the path
122-
to the function signature with any argument name (here `path_to_data`).
123-
124-
pytask assumes that all function arguments that do not have the {class}`~pytask.Product`
125-
annotation are dependencies of the task.
126-
127-
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_dependencies_py38.py
128-
:emphasize-lines: 11
129-
```
130-
131-
````
132-
133106
````{tab-item} produces
134107
:sync: produces
135108
@@ -158,24 +131,15 @@ are assumed to point to a location relative to the task module.
158131

159132
`````{tab-set}
160133
161-
````{tab-item} Python 3.10+
162-
:sync: python310plus
134+
````{tab-item} Annotated
135+
:sync: annotated
163136
164137
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_relative_py310.py
165138
:emphasize-lines: 8
166139
```
167140
168141
````
169142
170-
````{tab-item} Python 3.10
171-
:sync: python38plus
172-
173-
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_relative_py38.py
174-
:emphasize-lines: 8
175-
```
176-
177-
````
178-
179143
````{tab-item} produces
180144
:sync: produces
181145
@@ -192,8 +156,8 @@ Of course, tasks can have multiple dependencies and products.
192156

193157
`````{tab-set}
194158
195-
````{tab-item} Python 3.10+
196-
:sync: python310plus
159+
````{tab-item} Annotated
160+
:sync: annotated
197161
198162
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_multiple1_py310.py
199163
```
@@ -207,21 +171,6 @@ structures if needed.
207171
208172
````
209173
210-
````{tab-item} Python 3.10
211-
:sync: python38plus
212-
213-
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_multiple1_py38.py
214-
```
215-
216-
You can group your dependencies and product if you prefer not to have a function
217-
argument per input. Use dictionaries (recommended), tuples, lists, or more nested
218-
structures if needed.
219-
220-
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_multiple2_py38.py
221-
```
222-
223-
````
224-
225174
````{tab-item} produces
226175
:sync: produces
227176

docs/source/tutorials/repeating_tasks_with_different_inputs.md

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,14 @@ different seeds and output paths as default arguments of the function.
1313

1414
`````{tab-set}
1515
16-
````{tab-item} Python 3.10+
17-
:sync: python310plus
16+
````{tab-item} Annotated
17+
:sync: annotated
1818
1919
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs1_py310.py
2020
```
2121
2222
````
2323
24-
````{tab-item} Python 3.10
25-
:sync: python38plus
26-
27-
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs1_py38.py
28-
```
29-
30-
````
31-
3224
````{tab-item} produces
3325
:sync: produces
3426
@@ -49,22 +41,14 @@ You can also add dependencies to repeated tasks just like with any other task.
4941

5042
`````{tab-set}
5143
52-
````{tab-item} Python 3.10+
53-
:sync: python310plus
44+
````{tab-item} Annotated
45+
:sync: annotated
5446
5547
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs2_py310.py
5648
```
5749
5850
````
5951
60-
````{tab-item} Python 3.10
61-
:sync: python38plus
62-
63-
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs2_py38.py
64-
```
65-
66-
````
67-
6852
````{tab-item} produces
6953
:sync: produces
7054
@@ -109,22 +93,14 @@ For example, the following function is parametrized with tuples.
10993

11094
`````{tab-set}
11195
112-
````{tab-item} Python 3.10+
113-
:sync: python310plus
96+
````{tab-item} Annotated
97+
:sync: annotated
11498
11599
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs3_py310.py
116100
```
117101
118102
````
119103
120-
````{tab-item} Python 3.10
121-
:sync: python38plus
122-
123-
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs3_py38.py
124-
```
125-
126-
````
127-
128104
````{tab-item} produces
129105
:sync: produces
130106
@@ -150,22 +126,14 @@ a unique name for the iteration.
150126

151127
`````{tab-set}
152128
153-
````{tab-item} Python 3.10+
154-
:sync: python310plus
129+
````{tab-item} Annotated
130+
:sync: annotated
155131
156132
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs4_py310.py
157133
```
158134
159135
````
160136
161-
````{tab-item} Python 3.10
162-
:sync: python38plus
163-
164-
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs4_py38.py
165-
```
166-
167-
````
168-
169137
````{tab-item} produces
170138
:sync: produces
171139
@@ -236,22 +204,14 @@ Following these three tips, the parametrization becomes
236204

237205
`````{tab-set}
238206
239-
````{tab-item} Python 3.10+
240-
:sync: python310plus
207+
````{tab-item} Annotated
208+
:sync: annotated
241209
242210
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs5_py310.py
243211
```
244212
245213
````
246214
247-
````{tab-item} Python 3.10
248-
:sync: python38plus
249-
250-
```{literalinclude} ../../../docs_src/tutorials/repeating_tasks_with_different_inputs5_py38.py
251-
```
252-
253-
````
254-
255215
````{tab-item} produces
256216
:sync: produces
257217

docs/source/tutorials/using_a_data_catalog.md

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,14 @@ of our tasks. Here we see again the signature of the task function.
5555

5656
`````{tab-set}
5757
58-
````{tab-item} Python 3.10+
59-
:sync: python310plus
58+
````{tab-item} Annotated
59+
:sync: annotated
6060
6161
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_products_py310.py
6262
:lines: 10-12
6363
```
6464
````
6565
66-
````{tab-item} Python 3.10
67-
:sync: python38plus
68-
69-
```{literalinclude} ../../../docs_src/tutorials/defining_dependencies_products_products_py38.py
70-
:lines: 10-12
71-
```
72-
````
73-
7466
````{tab-item} produces
7567
:sync: produces
7668
@@ -94,8 +86,8 @@ The following tabs show you how to use the data catalog given the interface you
9486

9587
`````{tab-set}
9688
97-
````{tab-item} Python 3.10+
98-
:sync: python310plus
89+
````{tab-item} Annotated
90+
:sync: annotated
9991
10092
Use `data_catalog["data"]` as an default argument to access the
10193
{class}`~pytask.PickleNode` within the task. When you are done transforming your
@@ -107,19 +99,6 @@ Use `data_catalog["data"]` as an default argument to access the
10799
108100
````
109101
110-
````{tab-item} Python 3.10
111-
:sync: python38plus
112-
113-
Use `data_catalog["data"]` as an default argument to access the
114-
{class}`~pytask.PickleNode` within the task. When you are done transforming your
115-
{class}`~pandas.DataFrame`, save it with {meth}`~pytask.PickleNode.save`.
116-
117-
```{literalinclude} ../../../docs_src/tutorials/using_a_data_catalog_2_py38.py
118-
:emphasize-lines: 10, 21
119-
```
120-
121-
````
122-
123102
````{tab-item} ​produces
124103
:sync: produces
125104
@@ -133,7 +112,7 @@ Use `data_catalog["data"]` as an default argument to access the
133112
134113
````
135114
136-
````{tab-item} ​Python 3.10+ & Return
115+
````{tab-item} ​Annotated & Return
137116
:sync: return
138117
139118
An elegant way to use the data catalog is via return type annotations. Add
@@ -158,22 +137,13 @@ Following one of the interfaces gives you immediate access to the
158137

159138
`````{tab-set}
160139
161-
````{tab-item} Python 3.10+
162-
:sync: python310plus
140+
````{tab-item} Annotated
141+
:sync: annotated
163142
164143
```{literalinclude} ../../../docs_src/tutorials/using_a_data_catalog_3_py310.py
165144
:emphasize-lines: 12
166145
```
167146
168-
````
169-
170-
````{tab-item} Python 3.10
171-
:sync: python38plus
172-
173-
```{literalinclude} ../../../docs_src/tutorials/using_a_data_catalog_3_py38.py
174-
:emphasize-lines: 12
175-
```
176-
177147
````
178148
`````
179149

@@ -232,25 +202,16 @@ different node types which is not relevant now.
232202

233203
`````{tab-set}
234204
235-
````{tab-item} Python 3.10+
236-
:sync: python310plus
205+
````{tab-item} Annotated
206+
:sync: annotated
237207
238208
```{literalinclude} ../../../docs_src/tutorials/using_a_data_catalog_5_py310.py
239209
:emphasize-lines: 11, 12
240210
```
241211
242212
````
243213
244-
````{tab-item} Python 3.10
245-
:sync: python38plus
246-
247-
```{literalinclude} ../../../docs_src/tutorials/using_a_data_catalog_5_py38.py
248-
:emphasize-lines: 11, 12
249-
```
250-
251-
````
252-
253-
````{tab-item} ​Python 3.10+ & Return
214+
````{tab-item} ​Annotated & Return
254215
:sync: return
255216
256217
```{literalinclude} ../../../docs_src/tutorials/using_a_data_catalog_5_py310_return.py

0 commit comments

Comments
 (0)