Skip to content

Commit c7352f4

Browse files
committed
Track files on disk
1 parent 594bc98 commit c7352f4

File tree

2 files changed

+570
-0
lines changed

2 files changed

+570
-0
lines changed

maintenance_scripts/cleanup.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
from pathlib import Path
1212

1313
from spyglass.common import AnalysisNwbfile, Nwbfile
14+
from spyglass.common.common_file_tracking import (
15+
AnalysisFileIssues,
16+
FileMatch,
17+
TrackedFile,
18+
)
1419
from spyglass.common.common_version import SpyglassVersions
1520
from spyglass.decoding.decoding_merge import DecodingOutput
1621
from spyglass.decoding.v1.clusterless import schema as clusterless_schema
@@ -72,6 +77,16 @@ def cleanup_temp_dir(days_old: int = 7, dry_run: bool = True):
7277
print(f"Error cleaning temp_dir: {e}")
7378

7479

80+
def trask_files_on_disk():
81+
pop_kwargs = dict(
82+
order="random", display_progress=True, reserve_jobs=True, processes=15
83+
)
84+
85+
TrackedFile().run()
86+
FileMatch().populate(**pop_kwargs)
87+
AnalysisFileIssues().populate(**pop_kwargs)
88+
89+
7590
def main():
7691
print("Updating Spyglass versions table...")
7792
SpyglassVersions().fetch_from_pypi()
@@ -81,6 +96,8 @@ def main():
8196
cleanup_external_files()
8297
print("Cleaning up temporary directory...")
8398
cleanup_temp_dir(dry_run=False)
99+
print("Tracking files on disk...")
100+
trask_files_on_disk()
84101

85102

86103
if __name__ == "__main__":

0 commit comments

Comments
 (0)