Refactor SBX binary conversion for current IO flow#1242
Open
ytsimon2004 wants to merge 2 commits into
Open
Conversation
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.
Summary
This PR contains two fixes from
ytsimon2004:fix/sbx-to-binary-v1x:suite2p.io.sbx.sbx_to_binaryto match the current v1.x binary conversion handler interface used byrun_s2pscipy.stats.moderesult insparsedetect.pyto an integer scalar before it is used downstreamSBX Conversion
sbx_to_binarystill used the old API and calledinit_settings()/find_files_open_binaries(), which are no longer active in the current IO flow. That caused SBX input conversion to fail whenrun_s2pcalled the handler with(dbs, settings, files, files_chan2).The updated SBX converter now:
(dbs, settings, reg_file, reg_file_chan2)like the other current convertersdbs[0]["file_list"]db.npy/settings.npysbx_ndeadcolsauto-detection defaulting to-1sbx_ndeadrowsdefaulting to0, so row auto-detection only happens when users explicitly setdb["sbx_ndeadrows"] = -1Sparse Detection
estimate_spatial_scale()returned themode(..., keepdims=True)output as a NumPy array. Later code expected an integer scalar, which could raise:The fix returns
int(im.item()).Validation
Validated by successfully running Suite2p on
.sbxfiles from both single-plane and multi-plane recordings