Skip to content

Commit a887c55

Browse files
authored
Hotfix: freeze center (#811)
* freeze stimulus at center position * prepare release * ruff * fix tests
1 parent 6596a42 commit a887c55

File tree

7 files changed

+536
-25
lines changed

7 files changed

+536
-25
lines changed

CHANGELOG.md

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

4+
8.27.7
5+
* fixed: choice world family: visual stimulus could sometimes be moved after reward delivery
6+
47
8.27.6
58
------
69
* fixed: detection of LED control ability broken for Bpods with old firmware

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.6'
9+
__version__ = '8.27.7'

iblrig/base_choice_world.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ def export(self):
269269
'bonsai_closed_loop': daction,
270270
'bonsai_freeze_stim': daction,
271271
'bonsai_show_center': daction,
272+
'bonsai_freeze_center': daction,
272273
}
273274
)
274275

@@ -439,7 +440,7 @@ def get_state_machine_trial(self, i):
439440
sma.add_state(
440441
state_name='freeze_reward',
441442
state_timer=0,
442-
output_actions=[self.bpod.actions.bonsai_show_center],
443+
output_actions=[self.bpod.actions.bonsai_freeze_center],
443444
state_change_conditions={'Tup': 'reward'},
444445
)
445446
sma.add_state(

iblrig/hardware.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def define_rotary_encoder_actions(self, module: BpodModule | None = None) -> Non
203203
'bonsai_closed_loop': (module_port, self._define_message(module, [ord('#'), 3])),
204204
'bonsai_freeze_stim': (module_port, self._define_message(module, [ord('#'), 4])),
205205
'bonsai_show_center': (module_port, self._define_message(module, [ord('#'), 5])),
206+
'bonsai_freeze_center': (module_port, self._define_message(module, [ord('#'), 9])),
206207
}
207208
)
208209

@@ -370,7 +371,7 @@ def write_parameters(self):
370371
self.enable_evt_transmission()
371372

372373
def close(self):
373-
if getattr(self, 'arcom') is not None:
374+
if getattr(self, 'arcom') is not None: # noqa: B009
374375
log.debug(f'Closing serial connection to {self._name} on port {self.settings.COM_ROTARY_ENCODER}')
375376
super().close()
376377

iblrig_tasks/_iblrig_tasks_neuroModulatorChoiceWorld/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def get_state_machine_trial(self, i):
204204
sma.add_state(
205205
state_name='freeze_reward',
206206
state_timer=0,
207-
output_actions=[self.bpod.actions.bonsai_freeze_stim],
207+
output_actions=[self.bpod.actions.bonsai_freeze_center],
208208
state_change_conditions={'Tup': 'reward'},
209209
)
210210

visual_stim/GaborIBLTask/Gabor2D.bonsai

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@
10131013
<Name>BpodEvent</Name>
10141014
</Expression>
10151015
<Expression xsi:type="Condition">
1016-
<Name>STOP</Name>
1016+
<Name>Event #1 Hide Stim</Name>
10171017
<Workflow>
10181018
<Nodes>
10191019
<Expression xsi:type="WorkflowInput">
@@ -1067,7 +1067,7 @@
10671067
</Workflow>
10681068
</Expression>
10691069
<Expression xsi:type="Condition">
1070-
<Name>SHOW STIM</Name>
1070+
<Name>Event #8 Show Stim</Name>
10711071
<Workflow>
10721072
<Nodes>
10731073
<Expression xsi:type="WorkflowInput">
@@ -1151,7 +1151,7 @@ probably there is no need to reset the position also
11511151
</Workflow>
11521152
</Expression>
11531153
<Expression xsi:type="Condition">
1154-
<Name>CLOSE LOOP</Name>
1154+
<Name>Event #3 Closed Loop</Name>
11551155
<Workflow>
11561156
<Nodes>
11571157
<Expression xsi:type="WorkflowInput">
@@ -1396,7 +1396,46 @@ Value = whhel_radius for wheel_perim</Description>
13961396
<Name>BpodEvent</Name>
13971397
</Expression>
13981398
<Expression xsi:type="Condition">
1399-
<Name>StopConditionBpod</Name>
1399+
<Name>Event #9 Freeze Center</Name>
1400+
<Workflow>
1401+
<Nodes>
1402+
<Expression xsi:type="WorkflowInput">
1403+
<Name>Source1</Name>
1404+
</Expression>
1405+
<Expression xsi:type="Equal">
1406+
<Operand xsi:type="FloatProperty">
1407+
<Value>9</Value>
1408+
</Operand>
1409+
</Expression>
1410+
<Expression xsi:type="WorkflowOutput" />
1411+
</Nodes>
1412+
<Edges>
1413+
<Edge From="0" To="1" Label="Source1" />
1414+
<Edge From="1" To="2" Label="Source1" />
1415+
</Edges>
1416+
</Workflow>
1417+
</Expression>
1418+
<Expression xsi:type="Combinator">
1419+
<Combinator xsi:type="FloatProperty">
1420+
<Value>0</Value>
1421+
</Combinator>
1422+
</Expression>
1423+
<Expression xsi:type="Combinator">
1424+
<Combinator xsi:type="rx:Sample" />
1425+
</Expression>
1426+
<Expression xsi:type="Combinator">
1427+
<Combinator xsi:type="rx:Take">
1428+
<rx:Count>1</rx:Count>
1429+
</Combinator>
1430+
</Expression>
1431+
<Expression xsi:type="MulticastSubject">
1432+
<Name>StimLocationX</Name>
1433+
</Expression>
1434+
<Expression xsi:type="MulticastSubject">
1435+
<Name>UpdateSyncSquare</Name>
1436+
</Expression>
1437+
<Expression xsi:type="Condition">
1438+
<Name>Event #4 Freeze</Name>
14001439
<Workflow>
14011440
<Nodes>
14021441
<Expression xsi:type="WorkflowInput">
@@ -1443,33 +1482,40 @@ Value = whhel_radius for wheel_perim</Description>
14431482
<Edge From="1" To="2" Label="Source1" />
14441483
<Edge From="2" To="4" Label="Source1" />
14451484
<Edge From="2" To="5" Label="Source1" />
1446-
<Edge From="2" To="14" Label="Source2" />
1485+
<Edge From="2" To="20" Label="Source2" />
14471486
<Edge From="3" To="4" Label="Source2" />
14481487
<Edge From="3" To="6" Label="Source1" />
1449-
<Edge From="4" To="14" Label="Source1" />
1488+
<Edge From="4" To="20" Label="Source1" />
14501489
<Edge From="5" To="7" Label="Source2" />
14511490
<Edge From="6" To="7" Label="Source1" />
14521491
<Edge From="7" To="8" Label="Source1" />
14531492
<Edge From="8" To="9" Label="Source1" />
14541493
<Edge From="9" To="10" Label="Source1" />
1455-
<Edge From="10" To="13" Label="Source2" />
1494+
<Edge From="10" To="19" Label="Source3" />
14561495
<Edge From="11" To="12" Label="Source1" />
1457-
<Edge From="12" To="13" Label="Source1" />
1458-
<Edge From="13" To="18" Label="Source2" />
1496+
<Edge From="11" To="18" Label="Source1" />
1497+
<Edge From="12" To="19" Label="Source2" />
1498+
<Edge From="12" To="14" Label="Source2" />
1499+
<Edge From="13" To="14" Label="Source1" />
14591500
<Edge From="14" To="15" Label="Source1" />
14601501
<Edge From="15" To="16" Label="Source1" />
14611502
<Edge From="16" To="17" Label="Source1" />
1462-
<Edge From="16" To="20" Label="Source1" />
1463-
<Edge From="17" To="18" Label="Source1" />
14641503
<Edge From="18" To="19" Label="Source1" />
1504+
<Edge From="19" To="24" Label="Source2" />
1505+
<Edge From="20" To="21" Label="Source1" />
1506+
<Edge From="21" To="22" Label="Source1" />
1507+
<Edge From="22" To="23" Label="Source1" />
1508+
<Edge From="22" To="26" Label="Source1" />
1509+
<Edge From="23" To="24" Label="Source1" />
1510+
<Edge From="24" To="25" Label="Source1" />
14651511
</Edges>
14661512
</Workflow>
14671513
</Expression>
14681514
<Expression xsi:type="Combinator">
14691515
<Combinator xsi:type="rx:Switch" />
14701516
</Expression>
14711517
<Expression xsi:type="Condition">
1472-
<Name>SHOWCENTER</Name>
1518+
<Name>Event #5: Show Center</Name>
14731519
<Workflow>
14741520
<Nodes>
14751521
<Expression xsi:type="WorkflowInput">

0 commit comments

Comments
 (0)