Skip to content

Commit 75f6282

Browse files
authored
Minor fixes: recompute delete (#1413)
* Check matching env based on sorted dict, not fetch * nwb_dict -> nwb_deps * Remove spyglass from warning editable install warning * See details - `UserEnvironment` inherits mixin. - `v1.SpikeSortingRecording` passes hashing precision as a dictionary. - `SpyglassMixin.delete_orphans` convenience method added. - `NwbfileHasher` now ... - accepts an int as a default precision - checks that datasets are numeric before rounding - `RecordingRecompute`s now have `recheck` methods to double-check keys * Add tests * Update changelog * Fix failing tests * Update changelog * v0 recompute delete fixes * revert conflict edit. update changelog
1 parent 95d8de3 commit 75f6282

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import all foreign key references.
3030
### Infrastructure
3131

3232
- Auto-load within-Spyglass tables for graph operations #1368
33+
- Allow rechecking of recomputes #1380, #1413
3334

3435
### Pipelines
3536

src/spyglass/spikesorting/v0/spikesorting_recompute.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def delete_files(
513513
) -> None:
514514
"""If successfully recomputed, delete files for a given restriction."""
515515
query = self & "matched=1" & restriction
516-
file_names = query.fetch("analysis_file_name")
516+
file_names = query.fetch("nwb_file_name")
517517
prefix = "DRY RUN: " if dry_run else ""
518518
msg = f"{prefix}Delete {len(file_names)} files?\n\t" + "\n\t".join(
519519
file_names
@@ -528,8 +528,9 @@ def delete_files(
528528

529529
for key in query.proj():
530530
old, new = self._get_paths(key)
531-
new.unlink(missing_ok=True)
532-
old.unlink(missing_ok=True)
531+
logger.info(f"Deleting old: {old}, new: {new}")
532+
shutil_rmtree(old, ignore_errors=True)
533+
shutil_rmtree(new, ignore_errors=True)
533534

534535
def delete(self, *args, **kwargs) -> None:
535536
"""Delete recompute attempts when deleting rows."""

0 commit comments

Comments
 (0)