class autopilot.tasks.free_water.Free_Water(stage_block=None, current_trial=0, reward=50, allow_repeat=False, **kwargs)[source]

Bases: autopilot.tasks.task.Task

Randomly light up one of the ports, then dispense water when the subject pokes there

Two stages:

  • waiting for response, and
  • reporting the response afterwards
  • target ('L', 'C', 'R') – The correct port
  • trial_counter (itertools.count) – Counts trials starting from current_trial specified as argument
  • triggers (dict) – Dictionary mapping triggered pins to callable methods.
  • num_stages (int) – number of stages in task (2)
  • stages (itertools.cycle) – iterator to cycle indefinitely through task stages.
  • stage_block (threading.Event) – used to signal to the carrying Pilot that the current trial stage is over
  • current_trial (int) – If not zero, initial number of trial_counter
  • reward (int) – ms to open solenoids
  • allow_repeat (bool) – Whether the correct port is allowed to repeat between trials
  • **kwargs
STAGE_NAMES = ['water', 'response']
PARAMS = {'allow_repeat': {'tag': 'Allow Repeated Ports?', 'type': 'bool'}, 'reward': {'tag': 'Reward Duration (ms)', 'type': 'int'}}
DATA = {'target': {'plot': 'target', 'type': 'S1'}, 'timestamp': {'type': 'S26'}, 'trial_num': {'type': 'i32'}}
class TrialData

Bases: tables.description.IsDescription

columns = {'target': StringCol(itemsize=1, shape=(), dflt='', pos=None), 'timestamp': StringCol(itemsize=26, shape=(), dflt='', pos=None), 'trial_num': Int32Col(shape=(), dflt=0, pos=None)}
HARDWARE = {'LEDS': {'C': <class 'autopilot.core.hardware.LED_RGB'>, 'R': <class 'autopilot.core.hardware.LED_RGB'>, 'L': <class 'autopilot.core.hardware.LED_RGB'>}, 'POKES': {'C': <class 'autopilot.core.hardware.Beambreak'>, 'R': <class 'autopilot.core.hardware.Beambreak'>, 'L': <class 'autopilot.core.hardware.Beambreak'>}, 'PORTS': {'C': <class 'autopilot.core.hardware.Solenoid'>, 'R': <class 'autopilot.core.hardware.Solenoid'>, 'L': <class 'autopilot.core.hardware.Solenoid'>}}
PLOT = {'data': {'target': 'point'}}
water(*args, **kwargs)[source]

First stage of task - open a port if it’s poked.

Returns:Data dictionary containing:
'target': ('L', 'C', 'R') - correct response
'timestamp': isoformatted timestamp
'trial_num': number of current trial
Return type:dict

Just have to alert the Terminal that the current trial has ended and turn off any lights.


When shutting down, release all hardware objects and turn LEDs off.