Finish the 001933 demo notebook now that the dandiset is public - #210
Merged
Conversation
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 <[email protected]> Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_011NuStoQykizhQCx2KBrMCN
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Contributor
|
Preview for this PR has been removed (PR closed). |
Contributor
Executed notebooksCI 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ymlfrom before the contract existed. It is replaced by arequirements.inholding 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 aremfile.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_epochsis used by the full-session epoch map and by the whole PSTH section, but nothing ever defined it, so the notebook raisedNameErrorpartway 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 arestimulation_onwith powers drawn from the eight inPOWERS_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.Stim (500 ms)whileSTIM_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