Move ProbeInterface configurations from Bonsai file to JSON files #522
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.
This PR is a new effort to address #366.
This is not yet finished, but I have completed the work for Neuropixels 1.0 devices (
NeuropixelsV1e
/NeuropixelsV1f
) so that we can discuss the logic and the implementation.The major work centers around the
NeuropixelsV1ProbeConfiguration
class; most properties that used to be in the device node have been moved to the configuration class, since this is the most efficient way to consolidate information. I also added aProbeInterfaceFileName
property to the configuration, which is where the ProbeInterface configuration will be saved.Another major change is how the
ProbeGroup
class is initialized. Previously it was initialized during loading, but with the addition of the ProbeInterface file this led to issues. It is very easy for the filename to be set, but then the file be renamed or moved; this means that during loading there would be an exception thrown since the file doesn't exist, preventing the user from being able to successfully open the file. Therefore, now theProbeGroup
property has deferred loading, waiting for the first time the getter is called. This has the added benefit of fitting in with the Bonsai pattern where loading is deferred, allowing the filename to be modified via command line without issue, since the other way it could throw an exception during loading.The JSON files are only saved when the Bonsai file is saved, to prevent any desynchronization.
Note: Prior to modifying Neuropixels V2 to follow this pattern, this branch should contain the changes made in #493. There are significant changes made in that PR that would make merge conflicts incredibly nasty to untangle.