Session Kit: Module 03: Python and Jupyter for Neuroscience
Everything needed to run Module 03 as a taught session: prep, timing, materials, misconceptions, rubric.
Generated from modules/module03.md. Edit the module page, not this file.
At a glance
| Duration | 4 hours |
| Capability target | Create a reproducible Jupyter notebook that ingests a connectomics dataset slice, performs one analysis, and exports documented outputs. Demonstrate familiarity with the core Python libraries used in connectomics research: CAVEclient, CloudVolume, NetworkX, pandas, and matplotlib. |
| Learners leave with | A notebook that runs clean from a restarted kernel, with a header cell recording title, author, date, dataset, and materialization version |
Before you walk in
- You can state the capability target in one sentence without reading it.
- You have one worked example you will narrate, including where you are unsure.
- Data access works — accounts, viewer, notebook — verified today, not last week.
- The rubric is visible to learners before they start, not after.
- You have decided what “uncertain” earns, and you will say so out loud.
Learners should arrive having covered:
- Modules 01-02
Materials
Run of show
| Time | Segment | Your note |
|---|---|---|
| Header: title, author, date, dataset version, materialization version. | ||
| Setup: imports and environment configuration. | ||
| Data loading: queries and schema validation. | ||
| Analysis: computation cells with markdown explanations. | ||
| Export: saving outputs with metadata. | ||
| Initialize CAVEclient and set materialization version (3 min). | ||
| Query synapse table filtered by brain region (5 min). | ||
| Group by pre/post cell type and count synapses (5 min). | ||
| Build a NetworkX graph from the grouped data (5 min). | ||
| Plot a bar chart of top 10 connections by synapse count (4 min). |
The activity
Scenario: {: #studio-activity}
- Create a new notebook with a header cell: title, your name, date, dataset name, materialization version.
- Create a setup cell with all imports and version pinning.
- Initialize CAVEclient (or load a provided sample CSV if CAVE access is unavailable).
- Query or load a synapse table. Validate: print column names, data types, row count, and first 5 rows.
- Add a markdown cell explaining what the dataset contains and what version you are using.
- Choose one descriptive analysis from the following options:
- Write the analysis code with markdown cells explaining each step.
- Compute at least one summary statistic (mean, median, max, or standard deviation) and report it in a markdown cell.
- Create at least one publication-quality figure with labeled axes, title, and legend.
- Add a markdown caption below the figure explaining what it shows and what conclusions (if any) can be drawn.
- Export your data table as CSV and your figure as PNG.
- Create a metadata JSON cell recording dataset version, query parameters, and analysis date.
- Restart kernel and run all cells.
- Verify all outputs regenerate correctly.
- If any cell fails, fix it and re-run.
What learners hand in
- A notebook that runs clean from a restarted kernel, with a header cell recording title, author, date, dataset, and materialization version
- One descriptive analysis with at least one summary statistic reported in a markdown cell
- One labelled figure exported as PNG, with a caption stating what it shows and what it does not license you to conclude
- The underlying data table exported as CSV, plus a metadata JSON recording dataset version, query parameters, and analysis date
- If any cell fails, fix it and re-run
Misconceptions to target
These are the errors this session exists to prevent. Surface them in the debrief rather than pre-empting them in the lecture — a misconception a learner has voiced is far easier to correct than one they are holding silently.
- They may believe: You need to be an expert programmer to do connectomics. In practice, most analyses use a small set of patterns (query, filter, aggregate, plot) applied to different datasets.
- Surface it by asking: “What would have to be true for that to hold? What would change your mind?”
- They may believe: If the code runs on my machine, it is reproducible. Without version pinning, environment specification, and dataset versioning, results may differ across machines and time.
- Surface it by asking: “What would have to be true for that to hold? What would change your mind?”
- They may believe: Version control is only for software engineers. In research, version control is how you prove that your analysis produced the results you claim.
- Surface it by asking: “What would have to be true for that to hold? What would change your mind?”
- They may believe: Code comments are sufficient documentation. Markdown cells provide the narrative context — the why — that code comments alone cannot convey.
- Surface it by asking: “What would have to be true for that to hold? What would change your mind?”
Naming the norm
Every session is a chance to make one piece of the hidden curriculum explicit. Pick a moment where you would normally just do the professional thing, and say out loud why you are doing it — then ask whether anyone was taught that.
For this session, the candidate is whichever norm the activity most depends on: stating an assumption in the same sentence as the claim, recording the version a number came from, or saying “uncertain” and having it count as a real answer. See the hidden curriculum for the collected set and why naming them is a fairness intervention rather than etiquette.
Assessment
- Minimum: runnable notebook from clean kernel, clear outputs, basic metadata, at least one plot with labels.
- Strong: clean linear structure, robust error handling, repeatable rerun, markdown narrative explaining every step, exported metadata JSON, version-pinned requirements file.
- Failure: hidden state dependencies, undocumented assumptions, plots without labels, no dataset version recorded.
Grade the reasoning, not the answer. A correct call with no evidence chain should not outscore a well-reasoned incorrect one — and saying so publicly changes behaviour within one session.
Exit prompt
Add one markdown cell documenting input version, processing steps, and output files. Then write a code cell that queries a synapse table and computes the mean number of synapses per neuron for one brain region.
If this session goes wrong
- Nobody talks in the debrief. You asked “any questions?” Ask instead: “Which cue would you drop first if the data got worse?”
- Everyone finishes early. They are pattern-matching, not judging. Give an ambiguous case where the answer is “uncertain” and see what happens.
- Nobody finishes. The scaffolding came off too fast. Work the next case together rather than pressing on.
- A learner is silently lost. The most likely cause is unstated vocabulary. Point them at the dictionary and check back.