Skip to content

Commit c1787fe

Browse files
committed
Update DTDV411_style.ipynb
1 parent b1e41ab commit c1787fe

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

tutorials/4-developers/DTDV411_style.ipynb

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"\n",
6868
"from typing import Literal\n",
6969
"\n",
70-
"def process_values(mode: Literal[\"sum\", \"average\"]) -> float:\n",
70+
"def process_values(mode: Literal[\"sum\", \"average\"]) -> None:\n",
7171
" pass"
7272
]
7373
},
@@ -86,7 +86,7 @@
8686
"source": [
8787
"# Incorrect\n",
8888
"\n",
89-
"def process_values(mode: str) -> float:\n",
89+
"def process_values(mode: str) -> None:\n",
9090
" pass"
9191
]
9292
},
@@ -114,7 +114,7 @@
114114
"source": [
115115
"# Correct\n",
116116
"\n",
117-
"def calculate_average(numbers: list[int]) -> float:\n",
117+
"def calculate_average(numbers: list[int]) -> None:\n",
118118
" pass"
119119
]
120120
},
@@ -133,7 +133,7 @@
133133
"source": [
134134
"# Incorrect\n",
135135
"\n",
136-
"def calculate_average(numbers: list) -> float:\n",
136+
"def calculate_average(numbers: list) -> None:\n",
137137
" pass"
138138
]
139139
},
@@ -192,7 +192,7 @@
192192
"cell_type": "markdown",
193193
"metadata": {},
194194
"source": [
195-
"**NOTE:** Not all imports need to be placed at the top of the module. You can import libraries inside a class if they are only used within that class, or inside conditional statements if necessary."
195+
"**NOTE:** Not all imports need to be placed at the top of the module. You can import libraries inside a class if they are only used within that class, or even inside conditional statements if necessary."
196196
]
197197
},
198198
{
@@ -226,7 +226,7 @@
226226
"cell_type": "markdown",
227227
"metadata": {},
228228
"source": [
229-
"**NOTE:** The NumpyDoc guide specifies using phrases such as `int or list of int` rather than shorthand notations such as `int | list[int]`. We also prefer the phrases in the docstrings."
229+
"**NOTE:** The NumpyDoc guide specifies using phrases such as `int or float` rather than shorthand notations such as `int | float`. We also prefer the phrases in the docstrings."
230230
]
231231
},
232232
{
@@ -245,7 +245,7 @@
245245
},
246246
{
247247
"cell_type": "code",
248-
"execution_count": null,
248+
"execution_count": 8,
249249
"metadata": {},
250250
"outputs": [],
251251
"source": [
@@ -275,12 +275,12 @@
275275
" param3: \"numpy\" or \"torch\", optional\n",
276276
" This is a description of the third parameter. When the parameter is\n",
277277
" optional, its default value should be provided; in this case, \"numpy\".\n",
278-
" param4: list of int or None, optional\n",
278+
" param4: list[int] or None, optional\n",
279279
" This is a description of the fourth parameter. It defaults to None.\n",
280280
"\n",
281281
" Returns\n",
282282
" -------\n",
283-
" list of int\n",
283+
" list[int]\n",
284284
" This is a description of the return value. This can also be on multiple\n",
285285
" lines.\n",
286286
"\n",
@@ -292,6 +292,10 @@
292292
"\n",
293293
" Examples\n",
294294
" --------\n",
295+
" >>> import deeptrack as dt\n",
296+
"\n",
297+
" This line of code uses the function:\n",
298+
" \n",
295299
" >>> my_function(1, \"a\")\n",
296300
" [1, 2, 3]\n",
297301
"\n",
@@ -309,7 +313,7 @@
309313
},
310314
{
311315
"cell_type": "code",
312-
"execution_count": null,
316+
"execution_count": 9,
313317
"metadata": {},
314318
"outputs": [],
315319
"source": [
@@ -425,7 +429,7 @@
425429
},
426430
{
427431
"cell_type": "code",
428-
"execution_count": null,
432+
"execution_count": 10,
429433
"metadata": {},
430434
"outputs": [],
431435
"source": [
@@ -466,12 +470,7 @@
466470
"\n",
467471
"Functions:\n",
468472
"\n",
469-
"- `my_function(param1, param2)`\n",
470-
"\n",
471-
" def my_function(\n",
472-
" param1: int,\n",
473-
" param2: str,\n",
474-
" ) -> list[int]\n",
473+
"- `my_function(param1, param2) -> list[int]`\n",
475474
"\n",
476475
" Short description of the function.\n",
477476
"\n",

0 commit comments

Comments
 (0)