Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 2, 2026

SweepTable was deprecated in NWB 2.4.0 in favor of IntracellularRecordingsTable. This check flags files using the deprecated type with schema version >= 2.4.0.

Changes

  • New check: check_sweeptable_deprecated in src/nwbinspector/checks/_icephys.py

    • Reads nwb_version from HDF5 file attributes
    • Compares against 2.4.0 using semantic versioning
    • Returns BEST_PRACTICE_VIOLATION when deprecated type found in eligible files
    • Handles errors gracefully (missing attributes, file access failures, invalid versions)
  • Registration: Exported check in src/nwbinspector/checks/__init__.py

  • Tests: Added placeholder test documenting expected behavior in tests/unit_tests/test_icephys.py

    • Full integration testing requires older NWB files with SweepTable, as PyNWB 3.x+ prevents direct instantiation

Behavior

When an NWB file with version >= 2.4.0 contains a SweepTable:

# Message returned by check
"SweepTable is deprecated in NWB version 2.5.0. Use IntracellularRecordingsTable instead. See NWBFile.add_intracellular_recordings for more information."

The check runs automatically during inspect_nwbfile() when iterating over file objects.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dandiarchive.s3.amazonaws.com
    • Triggering command: /usr/bin/python3 python3 -m pytest tests/unit_tests/ -v --tb=short -x password=$GITHUB_TOKEN"; }; f r attr in dir(Swtr (dns block)
    • Triggering command: /usr/bin/python3 python3 -m pytest tests/unit_tests/ -v --tb=short (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Add Check]: Check for usage of deprecated SweepTable</issue_title>
<issue_description>### What would you like to see added to the NWBInspector?

The SweepTable neurodata type was deprecated in favor of the new intracellular electrophysiology metadata tables in NWB 2.4.0. We should trigger a best practice violation here if SweepTable is detected. See dandi/helpdesk#190

Pseudocode or other logic of the check

For all objects in the NWB file, if any is an instance of SweepTable and the NWB schema version is >= 2.4.0, then raise a Best Practice Violation

Do you have any interest in helping implement the check function?

Yes.

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • Have you ensured this check was not already requested?</issue_description>

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 2, 2026 22:48
Co-authored-by: rly <310197+rly@users.noreply.github.com>
…dback

Co-authored-by: rly <310197+rly@users.noreply.github.com>
Copilot AI changed the title [WIP] Add check for usage of deprecated SweepTable Add check for deprecated SweepTable in NWB files >= 2.4.0 Jan 2, 2026
Copilot AI requested a review from rly January 2, 2026 22:53
Copilot finished work on behalf of rly January 2, 2026 22:53
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 Check]: Check for usage of deprecated SweepTable

2 participants