Skip to content

Commit c0c86ca

Browse files
CBroz1Copilot
andauthored
Allow recompute via _make_file func (#1093)
* WIP: remove AnalysisNwbfileLog * WIP: recompute * WIP: recompute 2 * WIP: recompute 3 * WIP: recompute 4 * WIP: recompute 5, electrodes object * WIP: recompute 6, add file hash * WIP: recompute 7 * ✅ : recompute * Handle groups and links * Remove debug * Add directory hasher * Update directory hasher * WIP: update hasher * WIP: error specificity * Add tables for recompute processing * WIP: incorporate feedback * WIP: enforce environment restriction * WIP: typo * WIP: add tests * WIP: start add V0 hasher * See details v0.recompute: add make to recompute table v0.recording: - disable sort group deletes during tests - expand _make_file to take dest dir as arg - expand hasher method to optionally return hasher vX.recompute: - insert but don't recompute if logged at creation - add funcs for deleting successful recompute files v1.recording: don't log deps at Recording stage, only recompute nwb_hash: don't remove version, just ignore source_script tests: - migrate spikesorting.v1 tests to subfolder - add spikesorting.v0 tests for recording only v0 tests won't be captured in coverage for now * WIP: test fixes * WIP: test fixes * WIP: add safe round trip v0 * WIP: add doc * ✅ : Update docs * Skip failing decoding tests * nwb deps -> blob, future proof * Remove extra fields * WIP: store full env * Update comparators * Bypass spikeinterface version restriction * Minor fixes * Typo * Fix tests * Allow export env yml * Add note about conda required * Update limit docstring re random select * Update src/spyglass/common/common_lab.py Co-authored-by: Copilot <[email protected]> * Review comments * Defer recompute to after kachery/dandi fetch * Only fetch env once * Review suggestions @edeno * Increase UserEnv varchar * Warn on null restriction for 'attempt_all' * Handle 'no conda' case. Protect from partial v0 delete case. * More comment responses * v0.Recording also pops v0.Versions - fix pytest * PR review @samuelbray32 --------- Co-authored-by: Copilot <[email protected]>
1 parent fd2d06f commit c0c86ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3127
-425
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ repos:
7777
- tomli
7878

7979
- repo: https://github.com/ambv/black
80-
rev: 24.1.1
80+
rev: 25.1.0
8181
hooks:
8282
- id: black
83-
language_version: python3.9
83+
language_version: python3

CHANGELOG.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,30 @@
22

33
## [0.5.5] (Unreleased)
44

5+
### Release Notes
6+
7+
<!-- Running draft to be removed immediately prior to release. -->
8+
9+
<!-- When altering tables, import all foreign key references. -->
10+
511
Table update script
612

7-
```py
13+
```python
14+
# -- For recompute --
15+
import datajoint as dj
16+
from spyglass.spikesorting.v1 import recording as v1rec # noqa
17+
from spyglass.spikesorting.v0 import spikesorting_recording as v0rec # noqa
18+
from spyglass.linearization.v1.main import TrackGraph # noqa
19+
20+
dj.FreeTable(dj.conn(), "common_nwbfile.analysis_nwbfile_log").drop()
21+
dj.FreeTable(dj.conn(), "common_session.session_group").drop()
22+
TrackGraph.alter() # Add edge map parameter
23+
v0rec.SpikeSortingRecording().alter()
24+
v0rec.SpikeSortingRecording().update_ids()
25+
v1rec.SpikeSortingRecording().alter()
26+
v1rec.SpikeSortingRecording().update_ids()
27+
28+
# -- For LFP pipeline --
829
from spyglass.lfp.lfp_imported import ImportedLFP
930
from spyglass.lfp.lfp_merge import LFPOutput
1031

@@ -41,6 +62,7 @@ ImportedLFP().drop()
4162
- Only add merge parts to `source_class_dict` if present in codebase #1237
4263
- Remove cli module #1250
4364
- Fix column error in `check_threads` method #1256
65+
- Add recompute ability for `SpikeSortingRecording` for both v0 and v1 #1093
4466
- Track Spyglass version in dedicated table for enforcing updates #1281
4567
- Pin to `datajoint>=0.14.4` for `dj.Top` and long make call fix #1281
4668
- Remove outdated code comments #1304
@@ -87,8 +109,7 @@ ImportedLFP().drop()
87109
and transactional insertion. #1280, #1302
88110
- Updating the LFPBandSelection logic with comprehensive validation and batch
89111
insertion for electrodes and references. #1280
90-
- Implement `ImportedLFP.make()` for ingestion from nwb files #1278, #1302
91-
112+
- Implement `ImportedLFP.make()` for ingestion from nwb files #1278, #1302
92113

93114
## [0.5.4] (December 20, 2024)
94115

@@ -98,6 +119,7 @@ ImportedLFP().drop()
98119
#1108, #1172, #1187
99120
- Add docstrings to all public methods #1076
100121
- Update DataJoint to 0.14.2 #1081
122+
- Remove `AnalysisNwbfileLog` #1093
101123
- Allow restriction based on parent keys in `Merge.fetch_nwb()` #1086, #1126
102124
- Import `datajoint.dependencies.unite_master_parts` -> `topo_sort` #1116,
103125
#1137, #1162
@@ -109,6 +131,7 @@ ImportedLFP().drop()
109131
- Update DataJoint install and password instructions #1131
110132
- Fix dandi upload process for nwb's with video or linked objects #1095, #1151
111133
- Minor docs fixes #1145
134+
- Add Nwb hashing tool #1093
112135
- Test fixes
113136
- Remove stored hashes from pytests #1152
114137
- Remove mambaforge from tests #1153
@@ -168,6 +191,7 @@ ImportedLFP().drop()
168191
- Fix bug in `get_group_by_shank` #1096
169192
- Fix bug in `_compute_metric` #1099
170193
- Fix bug in `insert_curation` returned key #1114
194+
- Add fields to `SpikeSortingRecording` to allow recompute #1093
171195
- Fix handling of waveform extraction sparse parameter #1132
172196
- Limit Artifact detection intervals to valid times #1196
173197

docs/mkdocs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ nav:
7575
- Merge Tables: Features/Merge.md
7676
- Export: Features/Export.md
7777
- Centralized Code: Features/Mixin.md
78+
- Recompute: Features/Recompute.md
7879
- For Developers:
7980
- Overview: ForDevelopers/index.md
8081
- How to Contribute: ForDevelopers/Contribute.md
@@ -93,6 +94,7 @@ extra_css:
9394

9495
plugins:
9596
- search
97+
- mermaid2 # for graphs
9698
- exclude:
9799
glob:
98100
- "temp*"
@@ -125,7 +127,6 @@ plugins:
125127
include_source: False
126128
ignore_h1_titles: True
127129
ignore: ["*make_pages.py", "**checkpoints**", "*/py_scripts/*"]
128-
- mermaid2 # for graphs
129130

130131
markdown_extensions:
131132
- attr_list
@@ -139,6 +140,8 @@ markdown_extensions:
139140
- pymdownx.inlinehilite
140141
- pymdownx.snippets
141142
- pymdownx.superfences
143+
- pymdownx.tabbed:
144+
alternate_style: true
142145

143146
extra:
144147
generator: false # Disable watermark

0 commit comments

Comments
 (0)