Skip to content

Commit fdfaba9

Browse files
committed
critical bugfix in fiber assertion
1 parent b44453d commit fdfaba9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

iblrig/neurophotometrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def _validate_neurophotometrics_description(
254254
# assert each location being sampled at max twice and if so, by different bands
255255
for location in set(locations):
256256
ix = [i for i, loc in enumerate(locations) if loc == location]
257-
assert len(ix) == 2, 'there are only 2 possible bands'
257+
assert len(ix) <= 2, 'there are only 2 possible bands'
258258
rois_per_loc = [rois[i] for i in ix]
259259
# check that each band is present only once
260260
assert sum(True for roi in rois_per_loc if roi.startswith('G')) == 1, 'duplicate green band'

iblrig/test/test_neurophotometrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ class TestExperimentDescription(unittest.TestCase):
88
def test_neurophotometrics_description(self):
99
dt = datetime.datetime.fromisoformat('2024-10-11T11:11:00')
1010
d = neurophotometrics_description(
11-
rois=['Region1G', 'Region2G'], locations=['SI', 'VTA'], sync_channel=1, start_time=dt, sync_mode='bpod'
11+
rois=['G0', 'G1'], locations=['SI', 'VTA'], sync_channel=1, start_time=dt, sync_mode='bpod'
1212
)
1313
dexpected = {
1414
'devices': {
1515
'neurophotometrics': {
1616
'sync_channel': 1,
1717
'datetime': '2024-10-11T11:11:00',
1818
'collection': 'raw_photometry_data',
19-
'fibers': {'G1': {'location': 'SI'}, 'G2': {'location': 'VTA'}},
19+
'fibers': {'G0': {'location': 'SI'}, 'G1': {'location': 'VTA'}},
2020
'sync_mode': 'bpod',
2121
}
2222
}

0 commit comments

Comments
 (0)