Skip to content

Commit 2e165e0

Browse files
committed
Proofing edits
1 parent f1600fa commit 2e165e0

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

keynote.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ thank_you_slide: ../thank-you-slide/thank-you.html
5656
- 👩🏻‍💻 Software engineer at Bloomberg in NYC
5757
- ✨ Core developer of [numpydoc](https://github.com/numpy/numpydoc) and creator of [numpydoc's pre-commit hook](https://numpydoc.readthedocs.io/en/latest/validation.html#docstring-validation-using-pre-commit-hook), which uses static code analysis
5858
- ✍ Author of "[Hands-On Data Analysis with Pandas](https://stefaniemolin.com/books/Hands-On-Data-Analysis-with-Pandas-2nd-edition/)"
59-
- 🎓 Bachelor's in operations research from Columbia University
60-
- 🎓 Master's in computer science (ML specialization) from Georgia Tech
59+
- 🎓 Bachelor's degree in operations research from Columbia University
60+
- 🎓 Master's degree in computer science from Georgia Tech
6161

6262
[notes]
6363
This is a highly-technical keynote, but don't worry about getting lost or trying to take pictures of the code as its up on the screen because the slides are self-contained, and I have made them publicly-available on my website.
@@ -112,7 +112,7 @@ This is a highly-technical keynote, but don't worry about getting lost or trying
112112

113113
[data-transition=slide-in fade-out]
114114

115-
Let's see what this code snippet (`greet.py`) looks like represented as an AST:
115+
Let's see what this code snippet (`greet.py`) looks like when represented as an AST:
116116

117117
```python
118118
class Greeter:
@@ -278,25 +278,25 @@ Module(
278278

279279
<ul>
280280
<li class="fragment fade-in">
281-
Linters and formatters like <code>ruff</code> (Rust) and <code>black</code> (Python)
281+
Linters and formatters, like <code>ruff</code> (Rust) and <code>black</code> (Python)
282282
</li>
283283
<li class="fragment fade-in">
284-
Documentation tools like <code>sphinx</code> and the <code>numpydoc-validation</code> pre-commit hook
284+
Documentation tools, like <code>sphinx</code> and the <code>numpydoc-validation</code> pre-commit hook
285285
</li>
286286
<li class="fragment fade-in">
287-
Automatic Python syntax upgrade tools like <code>pyupgrade</code>
287+
Automatic Python syntax upgrade tools, like <code>pyupgrade</code>
288288
</li>
289289
<li class="fragment fade-in">
290-
Type checkers like <code>mypy</code>
290+
Type checkers, like <code>mypy</code>
291291
</li>
292292
<li class="fragment fade-in">
293-
Code security tools like <code>bandit</code>
293+
Code security tools, like <code>bandit</code>
294294
</li>
295295
<li class="fragment fade-in">
296-
Code and testing coverage tools like <code>vulture</code> and <code>coverage.py</code>
296+
Code and testing coverage tools, like <code>vulture</code> and <code>coverage.py</code>
297297
</li>
298298
<li class="fragment fade-in">
299-
Testing frameworks that instrument your code or generate tests based on it like <code>hypothesis</code> and <code>pytest</code>
299+
Testing frameworks that instrument your code or generate tests based on it, like <code>hypothesis</code> and <code>pytest</code>
300300
</li>
301301
</ul>
302302

@@ -388,7 +388,7 @@ class Greeter:
388388
Only <code>ast.Module</code>, <code>ast.ClassDef</code>, <code>ast.FunctionDef</code>, and <code>ast.AsyncFunctionDef</code> nodes can have docstrings:
389389
</p>
390390
<p class="fragment fade-in-then-out" data-fragment-index="2">
391-
<code>ast.get_docstring(node)</code> returns the docstring of <code>node</code> or <code>None</code>, if there isn't one:
391+
If there is one, <code>ast.get_docstring(node)</code> returns the docstring of <code>node</code>; otherwise, it returns <code>None</code>:
392392
</p>
393393
</div>
394394

@@ -490,7 +490,7 @@ We aren't visiting the list of AST nodes in the `ast.Module` node's `body` field
490490
<ul>
491491
<li class="fragment">Defined on base class <code>ast.NodeVisitor</code></li>
492492
<li class="fragment">Visits child nodes by calling <code>visit()</code> on any nodes returned from <code>ast.iter_fields()</code></li>
493-
<li class="fragment">Called automatically for node types we didn't create methods for</li>
493+
<li class="fragment">Called automatically for node types for which we didn't create methods</li>
494494
</ul>
495495

496496

@@ -503,7 +503,7 @@ We aren't visiting the list of AST nodes in the `ast.Module` node's `body` field
503503
We add the <code>_visit_helper()</code> method, which checks the docstring and then continues the traversal:
504504
</p>
505505
<p class="fragment fade-in-then-out" data-fragment-index="1">
506-
Calling <code>generic_visit()</code> on each node we check docstrings for ensures we continue the traversal:
506+
Calling <code>generic_visit()</code> on each node for which we check docstrings for ensures we continue the traversal:
507507
</p>
508508
<p class="fragment fade-in-then-out" data-fragment-index="2">
509509
Now, we switch to calling <code>_visit_helper()</code> whenever we visit module, class, or function nodes:
@@ -685,7 +685,7 @@ greet.Greeter.greet is missing a docstring
685685
<li class="fragment"><code>body</code>: AST of the function body, which can be used to infer return types, as well as whether the function raises any exceptions (out of scope)</li>
686686
</ul>
687687

688-
<p class="fragment">We will focus on fully-typed code for this keynote.</p>
688+
<p class="fragment">For this keynote, we will focus on fully-typed code.</p>
689689

690690
---
691691

@@ -944,7 +944,7 @@ Including a `*` in the function definition requires that the arguments following
944944
We ensure that the order of the arguments in the docstring matches their order in the function definition:
945945
</p>
946946
<p class="fragment fade-in-then-out" data-fragment-index="0">
947-
First, we include the positional arguments with the positional-only ones preceding the ones that can be passed by position or name:
947+
First, we include the positional arguments, with the positional-only ones preceding the ones that can be passed by position or name:
948948
</p>
949949
<p class="fragment fade-in-then-out" data-fragment-index="1">
950950
Next, we process the starred arguments. However, we only check whether <code>varargs</code> is present at this time, because it belongs in the positional arguments group:
@@ -1218,7 +1218,7 @@ Suggestions are great, but we can do better.
12181218
In order to properly indent the docstring, we need to add one additional level of indentation beyond what the function definition has (<code>col_offset</code>):
12191219
</p>
12201220
<p class="fragment fade-in-then-out" data-fragment-index="3">
1221-
The AST node we inject will be an <code>ast.Expr</code> node with an <code>ast.Constant</code> node inside containing the docstring itself:
1221+
The AST node we inject will be an <code>ast.Expr</code> node, with an <code>ast.Constant</code> node inside containing the docstring itself:
12221222
</p>
12231223
<p class="fragment fade-in-then-out" data-fragment-index="4">
12241224
The <code>suggest_docstring()</code> function includes the surrounding <code>"""</code>, so we need to remove them (<code>suggestion[3:-3]</code>):
@@ -1340,7 +1340,7 @@ class Greeter:
13401340
## Potential next steps
13411341

13421342
<ul>
1343-
<li class="fragment">Have <code>DocstringVisitor</code> and <code>DocstringTransformer</code> handle reading in the file and generating the AST</li>
1343+
<li class="fragment">Have <code>DocstringVisitor</code> and <code>DocstringTransformer</code> read in the file and generate the AST</li>
13441344
<li class="fragment">Infer whether a function has a return statement in the absence of a return type annotation</li>
13451345
<li class="fragment">Have <code>DocstringTransformer</code> convert the modified AST back to source code and save it to a file</li>
13461346
<li class="fragment">
@@ -1356,7 +1356,7 @@ class Greeter:
13561356

13571357
## Reference implementation
13581358

1359-
All examples herein were based on my project, **Docstringify**:
1359+
All examples herein were based on my open source project, **Docstringify**:
13601360

13611361
- Repository: <https://github.com/stefmolin/docstringify>
13621362
- PyPI: `python -m pip install docstringify`

0 commit comments

Comments
 (0)