diff --git a/src/np_workflows/shared/base_experiments.py b/src/np_workflows/shared/base_experiments.py index ed01334..67cb5a8 100644 --- a/src/np_workflows/shared/base_experiments.py +++ b/src/np_workflows/shared/base_experiments.py @@ -1,6 +1,7 @@ import abc import configparser import contextlib +import copy import enum import functools import pathlib @@ -677,14 +678,14 @@ def camstim_script(self) -> upath.UPath: def run_script(self, stim: Literal['sound_test', 'mapping', 'task', 'opto', 'optotagging', 'spontaneous', 'spontaneous_rewards']) -> None: - params = getattr(self, f'{stim.replace(" ", "_")}_params') + params = copy.deepcopy(getattr(self, f'{stim.replace(" ", "_")}_params')) # add mouse and user info for MPE params['mouse_id'] = str(self.mouse.id) params['user_id'] = self.user.id if self.user else 'ben.hardcastle' - script: str = params['taskScript'] - params['taskScript'] = (self.task_script_base / script).as_posix() + if self.task_script_base not in params['taskScript']: + params['taskScript'] = (self.task_script_base / params['taskScript']).as_posix() if self.is_pretest: params['maxFrames'] = 60 * 15