revert: require fileSizeBytes in SpikeGLX meta validation - #5
Merged
Conversation
Reverts the frame-alignment fallback added in #4. The root cause (SpikeGLX crashing before finishing its shutdown sequence, so fileSizeBytes/fileTimeSecs/fileSHA1 were never written) has been fixed upstream in SpikeGLX itself. These fields are relied on downstream for values we need, so validate_file should go back to treating their absence as an error rather than silently tolerating it. Previously-affected files will be corrected by a separate one-off script. This reverts commit 0f2e909. Assisted-by: ClaudeCode:claude-sonnet-5
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.
🤖 Human guided, AI assisted PR (using this skill). AI text below. 🤖
Summary
Reverts the frame-alignment fallback added in #4.
The underlying cause of the missing
fileSizeBytes/fileTimeSecs/fileSHA1fields has been identified and fixed: SpikeGLX itself was crashing before completing its shutdown/finalization sequence. That's now fixed at the source, so new recordings should always have these fields going forward.Since these fields are relied on downstream for values we need,
validate_fileshould go back to strictly requiringfileSizeBytesrather than tolerating its absence. The previously-affected.metafiles (from the two recordings that motivated #4) will be corrected in place by a separate one-off script, rather than having the reader permanently accommodate malformed metadata.Change
element_array_ephys/readers/spikeglx.py:SpikeGLX.validate_filereverted to its pre-#4 form — a directmeta.meta["fileSizeBytes"]lookup, raisingIOErroron mismatch (andKeyErrorif the key is absent, as before).Verified the resulting file is byte-identical to the state immediately prior to #4 (
git diffagainst that commit is empty for this file).Assisted-by: ClaudeCode:claude-sonnet-5