Skip to content

Commit

Permalink
suggest less frequent running of IntervalList cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbray32 committed Dec 4, 2024
1 parent cea52c5 commit a9261f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions docs/src/ForDevelopers/Management.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ be on disk.
Additionally, there are periphery tables such as `IntervalList` which are used
to store entries created by downstream tables. These entries are not
automatically deleted when the downstream entry is removed,
automatically deleted when the downstream entry is removed. To minimize interference
with ongoing user entry creation, we recommend running these cleanups on a less frequent
basis (e.g. weekly).
To remove orphaned files and entries, we run the following commands in our cron jobs:
Expand All @@ -245,7 +247,7 @@ from spyglass.decoding.v1.clusterless import schema as clusterless_schema
def main():
AnalysisNwbfile().nightly_cleanup()
SpikeSorting().nightly_cleanup()
IntervalList().nightly_cleanup()
IntervalList().cleanup()
nwbfile_schema.external['analysis'].delete(delete_external_files=True))
nwbfile_schema.external['raw'].delete(delete_external_files=True))
spikes_schema.external['analysis'].delete(delete_external_files=True))
Expand Down
2 changes: 1 addition & 1 deletion src/spyglass/common/common_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def plot_epoch_pos_raw_intervals(self, figsize=(20, 5), return_fig=False):
if return_fig:
return fig

def nightly_cleanup(self, dry_run=True):
def cleanup(self, dry_run=True):
"""Clean up orphaned IntervalList entries."""
orphans = self - get_child_tables(self)
if dry_run:
Expand Down

0 comments on commit a9261f9

Please sign in to comment.