Skip to content

Finish the 001933 demo notebook now that the dandiset is public - #210

Merged
bendichter merged 4 commits into
masterfrom
001933-dombeck-finish
Aug 23, 2026
Merged

Finish the 001933 demo notebook now that the dandiset is public#210
bendichter merged 4 commits into
masterfrom
001933-dombeck-finish

Conversation

@bendichter

Copy link
Copy Markdown
Member

Takes over #178 by @weiglszonja, whose three commits are preserved here, and finishes it. Dandiset 001933 was embargoed when that PR was opened and is now open, which is what unblocks it: the archive returns the dandiset to an anonymous client, and the session the notebook streams is still present among its 27 assets.

What changed

No more token. The client call was DandiAPIClient(token=os.environ.get("DANDI_API_KEY")), and the notebook and README both carried an admonition telling readers to export a key. All of that is gone, the same way #200 handled 000718 when it was unembargoed.

The submission contract. The directory had an environment.yml from before the contract existed. It is replaced by a requirements.in holding the same pip list plus the NWB extensions the file needs (ndx-fiber-photometry, ndx-optogenetics, ndx-ophys-devices), and re-locking against it moves the install cell from the Python 3.12 pin set to 3.13. The stream now goes through a remfile.DiskCache, since every plot in the notebook reads from the same file.

Two bugs that only executing it could find, which was not possible while the data were embargoed:

  • valid_epochs is used by the full-session epoch map and by the whole PSTH section, but nothing ever defined it, so the notebook raised NameError partway through and none of the last third rendered. It is the set of stimulation epochs at a power the colour map covers. I checked the file: all 64 epochs are stimulation_on with powers drawn from the eight in POWERS_LIST, so the selection is a no-op here, but it is written as a filter so a session with sham or out-of-range epochs behaves.
  • The PSTH shading was labelled Stim (500 ms) while STIM_DUR, computed from the epochs, is 410 ms. The label now follows the computed value.

Verification

Run end to end through the CI harness on Python 3.13, in both modes: the fresh-environment script path in 7.5 s and the kernel path in 8.8 s, producing 11 figures. The peri-stimulus figure shows the expected dopamine transient with a clean power series, 8 epochs per power level.

One note for the record: pynwb 3.1.3 warns that the file carries newer cached namespaces than the installed schema (core 2.10.0 against 2.9.0). It reads correctly, and the fleet is deliberately held below pynwb 4 for now, so I left it.

nwb-cache/ is added to .gitignore, since a disk cache is now written next to any notebook that runs locally.

Closes #178.

🤖 Generated with Claude Code

https://claude.ai/code/session_011NuStoQykizhQCx2KBrMCN

weiglszonja and others added 4 commits August 23, 2026 10:31
Dandiset 001933 was embargoed when this notebook was written and is now
open, so the notebook no longer needs a token to stream: the API key is
dropped from the client call and the accompanying admonitions come out
of the notebook and the README.

The submission contract arrived after the notebook was written, so this
adds the requirements.in it implies (the environment.yml pip list, plus
the NWB extensions the file needs) and drops environment.yml. Re-locking
against it moves the install cell onto the Python 3.13 pin set that
Colab now runs. The file is read repeatedly by the plots below it, so
the stream goes through a remfile.DiskCache.

Two problems surfaced when the notebook was actually executed, which had
not been possible while the data were embargoed. valid_epochs was used
by the epoch map and the PSTH section but never defined, so the notebook
failed partway through; it is the set of stimulation epochs at a power
the colour map covers, which is all 64 epochs of this session. And the
PSTH shading was labelled as a 500 ms stimulus where the epochs are
410 ms, so the label now follows the value computed from the data.

Co-authored-by: weiglszonja <wszonja@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NuStoQykizhQCx2KBrMCN
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

github-actions Bot added a commit that referenced this pull request Aug 23, 2026
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Preview for this PR has been removed (PR closed).

github-actions Bot added a commit that referenced this pull request Aug 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Executed notebooks

CI executes the notebooks changed in this PR through a Jupyter kernel and publishes each one, with its outputs, as soon as it finishes. Links appear below as notebooks complete; an hourglass means the notebook is still running.

1 of 1 finished. Commit 5bfa14d. The executed copies live only in the preview and are removed when the PR closes; nothing is committed to the branch.

@bendichter
bendichter merged commit aaabece into master Aug 23, 2026
6 checks passed
github-actions Bot added a commit that referenced this pull request Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants