From 3663acf4af353effacac5462431923173cd4dad4 Mon Sep 17 00:00:00 2001 From: pdesanex Date: Mon, 17 Jun 2024 16:01:46 +0100 Subject: [PATCH] move import of TCPclient (zapit) to start_hardware() to save CI --- iblrig_custom_tasks/nate_optoBiasedChoiceWorld/task.py | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iblrig_custom_tasks/nate_optoBiasedChoiceWorld/task.py b/iblrig_custom_tasks/nate_optoBiasedChoiceWorld/task.py index f2013ce..e82b5e0 100644 --- a/iblrig_custom_tasks/nate_optoBiasedChoiceWorld/task.py +++ b/iblrig_custom_tasks/nate_optoBiasedChoiceWorld/task.py @@ -21,11 +21,6 @@ from iblrig.base_choice_world import SOFTCODE, BiasedChoiceWorldSession from pybpodapi.protocol import StateMachine -sys.path.append('C:\zapit-tcp-bridge\python') -if find_spec('TCPclient') is None: - raise ImportError(f'{__file__} requires zapit-tcp-bridge') -from TCPclient import TCPclient - stim_location_history = [] log = logging.getLogger('iblrig.task') @@ -95,6 +90,7 @@ def __init__( self.task_params['OPTO_STOP_STATES'] = opto_stop_states self.task_params['MASK_TTL_STATES'] = mask_ttl_states self.task_params['PROBABILITY_OPTO_STIM'] = probability_opto_stim + self.client = None # generates the opto stimulation for each trial self.trials_table['opto_stimulation'] = np.random.choice( @@ -104,6 +100,10 @@ def __init__( ).astype(bool) def start_hardware(self): + sys.path.append(r'C:\zapit-tcp-bridge\python') + if find_spec('TCPclient') is None: + raise ImportError(f'{__file__} requires zapit-tcp-bridge') + from TCPclient import TCPclient self.client = TCPclient(tcp_port=1488, tcp_ip='127.0.0.1') self.client.close() # need to ensure is closed first; currently nowhere that this is defined at end of task! diff --git a/pyproject.toml b/pyproject.toml index 3c8e9f5..eaf93d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "project_extraction" -version = "0.2.4" +version = "0.2.5" description = "Custom extractors for satellite tasks" dynamic = [ "readme" ] keywords = [ "IBL", "neuro-science" ]