Skip to content

Commit

Permalink
Clean up saved model paths
Browse files Browse the repository at this point in the history
  • Loading branch information
edeno committed Jan 8, 2024
1 parent 3995e24 commit d14f40f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/spyglass/decoding/decoding_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,18 @@ def cleanup(self):
if str(path) not in table_results_paths:
logger.info(f"Removing {path}")
path.unlink()

table_model_paths = list(
chain(
*[
part_parent_table.fetch("classifier_path").tolist()
for part_parent_table in self.merge_get_parent(
multi_source=True
)
]
)
)
for path in Path(config["SPYGLASS_ANALYSIS_DIR"]).glob("**/*.pkl"):
if str(path) not in table_model_paths:
logger.info(f"Removing {path}")
path.unlink()

0 comments on commit d14f40f

Please sign in to comment.