WaterCalibrationTaskBase

class WaterCalibrationTaskBase(indices: list[int], times: list[float], maximum_number_of_trials: int)[source]

Bases: CalibrationTaskBase

Task that runs the sequence behind the Water Calibration panel (village/calibration/water_calibration.py): open each of a set of valves for its own given time, repeated a number of times, so the experimenter can weigh what came out and build a time->volume curve.

This default implementation drives a Bpod state machine, and is used automatically whenever the project’s controller is Bpod. For any other controller, subclass this in your project’s code directory and override start()/create_trial()/after_trial()/close() to run the same sequence on your own hardware – e.g. for an Arduino, create_trial() would send the valve-open/close commands over serial and wait out each time instead of building Bpod states. The __init__ signature below (indices, times, maximum_number_of_trials) must stay the same, since the calibration panel constructs your class with exactly these keyword arguments.

Like any CalibrationTaskBase, it is not listed in the TASKS tab, and without Bpod create_trial does not need to call register_start_trial.

Parameters:
  • indices (list[int]) – 0-based indices of the ports being calibrated/tested this run.

  • times (list[float]) – one valve-open time (seconds) per entry in indices, same order.

  • maximum_number_of_trials (int) – number of times to repeat the whole sequence (one repeat = one trial).

__init__(indices: list[int], times: list[float], maximum_number_of_trials: int) → None[source]

Methods

Attributes

start() → None[source]

Starts the task. Must be overridden by subclasses.

create_trial() → None[source]

Creates the state machine for the current trial. Must be overridden.