session— Session


Everytime a pybpodapi.bpod object is created, a new session is instantiated which stores information about the new experiment being run. There is only one session per Bpod. This session contains the list of trials (see pybpodapi.trial.Trial).

Besides storing trials, the session is also responsible for processing pybpodapi.state_occurrences.StateOccurrences and pybpodapi.event_occurrence.EventOccurrence when trial has finished. At this point, the information collected temporarily on the pybpodapi.state_machine.raw_data.RawData object is then persisted on the trial.


class pybpodapi.session.Session(path=None)[source]

Stores information about bpod run, including the list of trials.

  • trials (list(Trial)) – a list of trials
  • firmware_version (int) – firmware version of Bpod when experiment was run
  • bpod_version (int) – version of Bpod hardware when experiment was run
  • start_timestamp (datetime) – it stores session start timestamp

Get current trial

Return type:Trial