Skip to content

Commit 5cb5633

Browse files
Put style guide back where it belongs (NeuromatchAcademy#268)
* Put style guide back where it belongs * Process tutorial notebooks Co-authored-by: GitHub Action <[email protected]>
1 parent 0f45d48 commit 5cb5633

7 files changed

+724
-1447
lines changed

Neuromatch_Tutorial_Format.ipynb

-1,017
This file was deleted.

tutorials/demo/Neuromatch_Tutorial_Format.ipynb

+348-217
Large diffs are not rendered by default.

tutorials/demo/solutions/Neuromatch_Tutorial_Format_Solution_25ac40cb.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
"""
3+
Discussion: Write a dicussion about/answers to any open-ended questions you pose (either about a demo or elsewhere)
4+
5+
You can write a paragraph or two of nice didactic text
6+
within a single comment.
7+
""";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
def generic_function(x):
2+
"""Google style doc string. Brief summary of what function does here
3+
4+
Args:
5+
x (ndarray): An array of shape (N,) that contains blah blah
6+
7+
Returns:
8+
ndarray: The output is blah blah
9+
"""
10+
11+
# Have a comment for every line of code they need to write, and when possible have
12+
# variables written with ellipses where they should fill in or ellipses where they should
13+
# fill in inputs to functions
14+
y = multiply_array(x, 5)
15+
16+
# Another comment because they need to add another line of code
17+
z = y + 6
18+
19+
return z
20+
21+
# Uncomment below to test your function
22+
x = np.array([4, 5, 6])
23+
z = generic_function(x)
24+
25+
# xkcd style for solution plot
26+
with plt.xkcd():
27+
plotting_z(z)
28+
# we often invoke a plotting function hidden in Helper Functions so students don't
29+
# have to uncomment a lot of boilerplate matplotlib code
Loading

tutorials/demo/student/Neuromatch_Tutorial_Format.ipynb

+340-213
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)