Skip to content

Commit 7b986ae

Browse files
authored
Merge pull request #769 from int-brain-lab/iblrigv8dev
8.27.3
2 parents b6bd70f + 1b5c220 commit 7b986ae

15 files changed

+712
-543
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
8.27.3
5+
------
6+
* changed: reset camera(s) prior to starting task when inconsistencies have been detected
7+
* changed: include stock subjects if user is stock manager
8+
* changed: skip validation of Ambient Module if device_bpod.USE_AMBIENT_MODULE is false
9+
* added: `remove_bonsai_layouts` command for troubleshooting BONSAI GUIs not appearing
10+
411
8.27.2
512
------
613
* fixed: error when using task arguments of type bool

docs/source/faq.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ Camera Issues
9393
* If you use a USB 3.1 Host Controller Card check if it requires additional powering through a SATA or Molex cable.
9494
FLIR offers `a few models <https://www.flir.com/products/usb-3.1-host-controller-card>`_ that should work fine.
9595

96+
* If the BONSAI panels for the video live view do not show up there might be an issue with the
97+
`BONSAI layout settings <https://bonsai-rx.org/docs/articles/editor.html#visualizer-layout-settings>`_.
98+
To reset these layout settings, run the following in PowerShell:
99+
100+
.. code::
101+
102+
C:\iblrigv8\venv\scripts\Activate.ps1
103+
remove_bonsai_layouts
104+
96105
97106
Frame2TTL
98107
=========

docs/source/usage_video.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Below shows how to start the cameras for the subject 'example' with configuratio
6262
6363
cd C:\iblrigv8\
6464
venv\scripts\Activate.ps1
65-
start_video_session example default
65+
start_video_session --subject_name example --profile default
6666
6767
Copy command
6868
------------

iblrig/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# 5) git tag the release in accordance to the version number below (after merge!)
77
# >>> git tag 8.15.6
88
# >>> git push origin --tags
9-
__version__ = '8.27.2'
9+
__version__ = '8.27.3'

iblrig/base_tasks.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,11 +806,14 @@ def start_mixin_bonsai_cameras(self):
806806
if (workflow_file := self._camera_mixin_bonsai_get_workflow_file(configuration, 'setup')) is None:
807807
return
808808

809+
# test acquisition and reset cameras if needed
809810
# enable trigger of cameras (so Bonsai can disable it again ... sigh)
810811
if PYSPIN_AVAILABLE:
811-
from iblrig.video_pyspin import enable_camera_trigger
812+
from iblrig import video_pyspin
812813

813-
enable_camera_trigger(True)
814+
if not video_pyspin.acquisition_ok():
815+
video_pyspin.reset_all_cameras()
816+
video_pyspin.enable_camera_trigger(True)
814817

815818
call_bonsai(workflow_file, wait=True) # TODO Parameterize using configuration cameras
816819
log.info('Bonsai cameras setup module loaded: OK')

iblrig/commands.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,22 @@ def flush():
365365
bpod = Bpod(hardware_settings['device_bpod']['COM_BPOD'])
366366
bpod.flush()
367367
bpod.close()
368+
369+
370+
def remove_bonsai_layouts():
371+
"""Delete all BONSAI .layout files - if they are backed up with a .layout_template file."""
372+
from iblrig.constants import BASE_PATH
373+
374+
layout_files = [x for x in BASE_PATH.glob('**/*.bonsai.layout') if x.with_suffix('.layout_template').exists()]
375+
if len(layout_files) == 0:
376+
print('No layout files found.')
377+
return
378+
print('The following files will be deleted:')
379+
for f in layout_files:
380+
print(f'- {f.name}')
381+
if input('\nContinue? [Y/n] ').lower() in ('y', ''):
382+
for f in layout_files:
383+
f.unlink()
384+
print(f'{len(layout_files)} file{"s" if len(layout_files) > 1 else ""} deleted.')
385+
else:
386+
print('No files deleted.')

iblrig/gui/wizard.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,13 @@ def login(
254254
)
255255
QtWidgets.QMessageBox().critical(None, 'Error', f'{message}\n\n{solution}')
256256

257-
# get subjects from Alyx: this is the set of subjects that are alive and not stock in the lab defined in settings
258-
rest_subjects = self.alyx.rest(
259-
'subjects', 'list', alive=True, stock=False, lab=self.iblrig_settings['ALYX_LAB'], no_cache=True
260-
)
257+
# get subjects from Alyx: this is the set of subjects that are alive and in the lab defined in settings
258+
# stock subjects are excluded, unless the user is stock manager
259+
kwargs = {'alive': True, 'lab': self.iblrig_settings['ALYX_LAB'], 'no_cache': True}
260+
is_stock_manager = any(self.alyx.rest('subjects', 'list', responsible_user=self.user, stock=True, limit=1, **kwargs))
261+
if not is_stock_manager:
262+
kwargs['stock'] = False
263+
rest_subjects = self.alyx.rest('subjects', 'list', **kwargs)
261264
self.all_subjects.remove(self.test_subject_name)
262265
self.all_subjects = [self.test_subject_name] + sorted(set(self.all_subjects + [s['nickname'] for s in rest_subjects]))
263266

iblrig/hardware_validation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,11 @@ class ValidatorAmbientModule(Validator):
301301
_name = 'Bpod Ambient Module'
302302

303303
def _run(self):
304+
# skip if ambient module is not being used
305+
if not self.hardware_settings.device_bpod.USE_AMBIENT_MODULE:
306+
yield Result(Status.SKIP, 'Ambient module is not being used - skipping validation')
307+
return False
308+
304309
# yield Bpod's connection status
305310
bpod = yield from self._get_bpod()
306311
if bpod is None:

iblrig/pydantic_definitions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class HardwareSettingsBpod(BunchModel):
9696
SOUND_BOARD_BPOD_PORT: Literal['Serial1', 'Serial2', 'Serial3', 'Serial4', 'Serial5', None] = None
9797
ROTARY_ENCODER_BPOD_PORT: Literal['Serial1', 'Serial2', 'Serial3', 'Serial4', 'Serial5', None] = None
9898
DISABLE_BEHAVIOR_INPUT_PORTS: list[BehaviourInputPort] = [2, 3, 4]
99+
USE_AMBIENT_MODULE: bool = True
99100

100101

101102
class HardwareSettingsFrame2TTL(BunchModel):

iblrig/test/test_commands.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)