diff --git a/docs/src/ForDevelopers/Management.md b/docs/src/ForDevelopers/Management.md index afabc1a4e..df0caae81 100644 --- a/docs/src/ForDevelopers/Management.md +++ b/docs/src/ForDevelopers/Management.md @@ -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: @@ -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)) diff --git a/src/spyglass/common/common_interval.py b/src/spyglass/common/common_interval.py index 25670f03c..2021c5f69 100644 --- a/src/spyglass/common/common_interval.py +++ b/src/spyglass/common/common_interval.py @@ -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: