Skip to content

Commit 964c124

Browse files
committed
Log unlinking and only unlink pngs
1 parent a6cee9a commit 964c124

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

derotation/analysis/full_derotation_pipeline.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,15 @@ def load_data(self):
214214
Path(self.debug_plots_folder).mkdir(parents=True, exist_ok=True)
215215

216216
# unlink previous debug plots
217+
logging.info("Deleting previous debug plots...")
217218
for item in self.debug_plots_folder.iterdir():
218219
if item.is_dir():
219220
for file in item.iterdir():
220-
file.unlink()
221+
if file.suffix == ".png":
222+
file.unlink()
221223
else:
222-
item.unlink()
224+
if item.suffix == ".png":
225+
item.unlink()
223226

224227
logging.info(f"Dataset {self.filename_raw} loaded")
225228
logging.info(f"Filename: {self.filename}")

0 commit comments

Comments
 (0)