WaterCalibrationTaskBase
- class WaterCalibrationTaskBase(indices: list[int], times: list[float], maximum_number_of_trials: int)[source]
Bases:
TaskBaseTask 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.
- 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.
- after_trial() None[source]
Executed after each trial completes. Must be overridden.
- close() None[source]
Closes the task and releases resources. Must be overridden.