Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions maintenance_scripts/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
from pathlib import Path

from spyglass.common import AnalysisNwbfile, Nwbfile
from spyglass.common.common_file_tracking import (
AnalysisFileIssues,
FileMatch,
TrackedFile,
)
from spyglass.common.common_version import SpyglassVersions
from spyglass.decoding.decoding_merge import DecodingOutput
from spyglass.decoding.v1.clusterless import schema as clusterless_schema
Expand Down Expand Up @@ -72,6 +77,16 @@ def cleanup_temp_dir(days_old: int = 7, dry_run: bool = True):
print(f"Error cleaning temp_dir: {e}")


def trask_files_on_disk():
pop_kwargs = dict(
order="random", display_progress=True, reserve_jobs=True, processes=15
)

TrackedFile().run()
FileMatch().populate(**pop_kwargs)
AnalysisFileIssues().populate(**pop_kwargs)


def main():
print("Updating Spyglass versions table...")
SpyglassVersions().fetch_from_pypi()
Expand All @@ -81,6 +96,8 @@ def main():
cleanup_external_files()
print("Cleaning up temporary directory...")
cleanup_temp_dir(dry_run=False)
print("Tracking files on disk...")
trask_files_on_disk()


if __name__ == "__main__":
Expand Down
Loading
Loading