-
Notifications
You must be signed in to change notification settings - Fork 52
Allow recompute via _make_file func
#1093
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
Conversation
|
I ran in to some issues here, being unable to replicate the DJ-stored file hash with seemingly matched contents. Need to do more testing on whether or not memory pointers are factored into the hash. If so, we may need to store a hash of the object computed by the specific table, and adjust the DJ-stored file hash on recreation |
edeno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the overall structure looks pretty good. For comparing arrays, remind me why something like np.allclose wouldn't work well?
|
Just adding a reminder here to warn the lab before this gets merged. |
I've updated the logic to defer recompute until after the check of dandi/kachery. I think it's the case that the recompute is only going to be attempted if we have a database entry, but no corresponding file. Therefore, it would only trigger for a collaborator if they loaded a dump of our database, but didn't get all the files ... and also, the files are on neither remote store |
edeno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor things and questions. I am still working on testing out the code on real data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new recompute ability via a dedicated _make_file function that enables dynamic regeneration of NWB files when they are missing. Key changes include standardizing file creation across multiple pipelines, updating file‐path and hashing tools in AnalysisNwbfile, and removing redundant logging calls to streamline the recompute process.
Reviewed Changes
Copilot reviewed 71 out of 71 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/spyglass/lfp/v1/lfp.py | Removed a redundant logging call in the make method to support the new recompute approach. |
| src/spyglass/lfp/analysis/v1/lfp_band.py | Similar removal of logging call to standardize behavior across LFP analysis tables. |
| src/spyglass/decoding/v1/waveform_features.py | Removed pre-create timing call and logging call associated with NWB file creation. |
| src/spyglass/decoding/v0/clusterless.py | Removed logging call from file creation logic to simplify recompute handling. |
| src/spyglass/common/common_nwbfile.py | Updated the AnalysisNwbfile.create and get_abs_path methods to accept additional parameters for recompute functionality. |
| docs/* | Updated documentation pages and changelog to reflect the new recompute feature. |
| pyproject.toml & .pre-commit-config.yaml | Updated dependency versions and configuration adjustments. |
Comments suppressed due to low confidence (2)
src/spyglass/lfp/v1/lfp.py:201
- [nitpick] The removal of the logging call appears intentional to support the new recompute workflow; consider adding an inline comment or documentation note explaining the alternative mechanism for tracking NWB file creation events.
AnalysisNwbfile().log(key, table=self.full_table_name)
src/spyglass/decoding/v0/clusterless.py:262
- [nitpick] As with other parts of the codebase, the removal of the logging call should be accompanied by documentation that explains how NWB file creation events are now tracked, ensuring consistency across the recompute pipelines.
AnalysisNwbfile().log(key, table=self.full_table_name)
Description
This PR adds the ability to recompute when fetching a non-existent file from
v1.SpikeSortingRecording, adding some infrastructure to support expanding this tool in the future. To facilitate this, I add ..._make_filefunc that other tables can implement in the future.fetch_nwbor a new v0load_recordingfunction that centralizes file regeneration logicCloses #773
Closes #917
Closes #1272
Checklist:
CITATION.cffaltersnippet for release notes.CHANGELOG.mdwith PR number and description.