Skip to content

Commit

Permalink
move import of TCPclient (zapit) to start_hardware() to save CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Jun 17, 2024
1 parent bf63f52 commit 3663acf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions iblrig_custom_tasks/nate_optoBiasedChoiceWorld/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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(
Expand All @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down

0 comments on commit 3663acf

Please sign in to comment.