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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
Changelog
---------

8.15.6
------
* hotfix: backup duds to tmp folder before deleting from GUI

8.15.5
------
* hotfix: show Garbor patch in passive choice-world, GUI option for session ID, no dud detection

8.15.4
------
* hotfix: disable prompt for deleting "duds" for appended sessions
* hotfix: disable prompt for deleting "duds" for appended sessions

8.15.3
------
Expand Down
13 changes: 7 additions & 6 deletions iblrig/gui/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,20 +1017,21 @@ def _on_task_finished(self, exit_code, exit_status):
session_data = json.load(fid)

# check if session was a dud
if (
(ntrials := session_data['NTRIALS']) < 42
and not any([x in self.model.task_name for x in ('spontaneous', 'passive')])
and not self.uiCheckAppend.isChecked()
if (ntrials := session_data['NTRIALS']) < 42 and not any(
[x in self.model.task_name for x in ('spontaneous', 'passive')]
):
answer = QtWidgets.QMessageBox.question(
self,
'Is this a dud?',
f"The session consisted of only {ntrials:d} trial"
f"{'s' if ntrials > 1 else ''} and appears to be a dud.\n\n"
f"Should it be deleted?",
f"Should it be deleted?\n\nNote:A Backup will be created in a temporary folder",
)
if answer == QtWidgets.QMessageBox.Yes:
shutil.rmtree(self.model.session_folder)
if backup_session(self.model.raw_data_folder):
print(f'Backup was successful, removing directory {session_path}...')
shutil.rmtree(self.model.raw_data_folder)
shutil.rmtree(self.model.raw_data_folder)
return

# manage poop count
Expand Down