Skip to content

Move Probe Interface configuration files to external JSON files #481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bparks13
Copy link
Member

Overview

This PR refactors how probe configuration data is stored and managed across Neuropixels 1.0, Neuropixels 2.0, and RHS2116 devices. The main changes involve externalizing probe interface files into JSON format and improving error handling around file operations.

Key Changes

  • Moved calibration file paths into respective ProbeConfiguration classes for better encapsulation
  • Added ProbeInterfaceFile properties to manage external JSON configuration files
  • Improved error handling for file operations with specific exception types
  • Renamed UI elements from "Channel Configuration" to "Probe Group" for consistency
  • Added GenericPropertyConverter for better property management in UI
  • Cleaned up unused dependencies and imports

Breaking Changes

  1. Calibration file properties have been moved:

    • From ConfigureNeuropixelsV1/ConfigureNeuropixelsV2 classes to their respective ProbeConfiguration classes
    • Old properties are marked as obsolete and will be removed in v1.0.0
  2. Configuration files are now stored externally:

    • JSON files with pi_*.json extension for automatically created file paths
    • Generated automatically when saving Bonsai workflows
    • Can be manually specified via ProbeInterfaceFile property

Migration Guide

For existing workflows:

  1. Calibration files will be automatically migrated to the new ProbeConfiguration location
    • This is only true for Neuropixels 1.0f and Neuropixels 2.0e/Beta probes. Due to how the properties are organized for Neuropixels 1.0e they cannot be automatically migrated.
  2. Probe interface files will be generated automatically next to .bonsai files
  3. No manual changes required for existing configurations

Fixes #366

@bparks13 bparks13 added this to the 0.7.0 milestone Aug 11, 2025
@bparks13 bparks13 requested a review from jonnew August 11, 2025 20:15
- Removed the #nullable enable preprocessor directives
- Changed public property to be ProbeInterfaceFileName
- Remove private backing field, and also remove custom logic to enforce .json extension in manually typed filenames
- Added SaveFileNameEditor to all ProbeInterfaceFileName properties
- Modified comments to be more explicit in that the obsolete properties/methods will be removed in 1.0.0
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.

ProbeConfiguration is deserializing ChannelConfiguration to XML
1 participant