Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

Adds documentation section demonstrating fine-grained NWB file content extraction to BIDS sidecars per BEP32. Located after tutorials, uses same ecephys example data.

Changes

  • docs/conversion_gallery.rst - New 450+ line documentation covering:

    • Reading NWB files with PyNWB (devices, electrode tables, ElectricalSeries)
    • BIDS sidecar generation (probes.tsv, electrodes.tsv, channels.tsv)
    • Field-to-field mapping tables for each metadata type
    • Subject/session metadata extraction to participants.tsv, sessions.tsv
  • docs/index.rst - Added conversion_gallery to toctree after tutorials

  • docs/conftest.py - Extended setup to pre-convert tutorial data for gallery examples

Example

Shows how NWB electrode table maps to BIDS sidecars:

# Read from NWB
electrodes_table = nwbfile.electrodes.to_dataframe()
# location, group_name, imp, filtering columns

# Extract to BIDS
bids_electrodes_df = pd.read_csv("sub-001_ses-A_electrodes.tsv", sep="\t")
# name, probe_name, location, impedance columns

Includes complete mapping tables like:

NWB Field BIDS Field
electrodes.id name
electrodes.group.device.name probe_name
electrodes.imp impedance (kOhms)

Screenshot

Conversion Gallery

All code examples are executable and doc-tested (32 tests).

Original prompt

This section details on the original issue you should resolve

<issue_title>Add conversion gallery</issue_title>
<issue_description>Showcasing the fine-grain file contents in line with BEP32</issue_description>

<agent_instructions>This should be a section of the docs after the tutorial that uses the same data but goes deep into the content of each NWB file (using PyNWB to read and display) and shows side-by-side what is extracted into BIDS sidecars</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 23, 2026 02:55
Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com>
Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com>
Copilot AI changed the title [WIP] Add conversion gallery to showcase file contents Add conversion gallery documentation for NWB to BIDS mapping Jan 23, 2026
Copilot AI requested a review from CodyCBakerPhD January 23, 2026 03:04
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (conversion_gallery@84ce669). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                  @@
##             conversion_gallery     #286   +/-   ##
=====================================================
  Coverage                      ?   84.48%           
=====================================================
  Files                         ?       36           
  Lines                         ?     1424           
  Branches                      ?        0           
=====================================================
  Hits                          ?     1203           
  Misses                        ?      221           
  Partials                      ?        0           
Flag Coverage Δ
unittests 84.48% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CodyCBakerPhD
Copy link
Collaborator

@copilot Could you fix the pre-commit? Do you know why you didn't do it in the first place (given it is specified in the copilot instructions)

@CodyCBakerPhD CodyCBakerPhD changed the base branch from main to conversion_gallery January 23, 2026 03:31
@CodyCBakerPhD
Copy link
Collaborator

@copilot Nevermind, I'll deal with it myself. This is a good start, thank you

@CodyCBakerPhD CodyCBakerPhD marked this pull request as ready for review January 23, 2026 03:31
@CodyCBakerPhD CodyCBakerPhD merged commit 17a4b7f into conversion_gallery Jan 23, 2026
54 of 56 checks passed
@CodyCBakerPhD CodyCBakerPhD deleted the copilot/add-conversion-gallery branch January 23, 2026 03:31
Copilot stopped work on behalf of CodyCBakerPhD due to an error January 23, 2026 03:32
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.

Add conversion gallery

2 participants