OnlineSessionFigure#

class OnlineSessionFigure(fig: Figure | None = None, last_trials: int = 100, window: int = 20, figsize: tuple = (16, 7), style: str | Style | None = None)[source]#

Bases: object

The figure of the online plot:

  • top: the last trials, one per column: the correct side (coloured by modality, darker for easier trials) with a dot on the side the mouse chose, and the outcome (correct, error, timeout, early withdrawal). Above them, the performance and the early withdrawals in the last window trials.

  • bottom: a summary of the session; the choices by side and difficulty of each modality; the performance on each side; win-stay / lose-switch of the session.

In habituation (no correct side) the strip shows the side the mouse went to, and the rest says it is not used.

Parameters:
  • fig – draw here (default: a new figure of figsize).

  • last_trials – trials shown in the strip.

  • window – trials of the rolling performance.

  • style – the colours (see style.py; default: the active style).

__init__(fig: Figure | None = None, last_trials: int = 100, window: int = 20, figsize: tuple = (16, 7), style: str | Style | None = None) → None[source]#

Methods

__init__([fig, last_trials, window, ...])

add_trials(df)

Brings the table of trials up to date with df (the trials of the session so far): only the new trials are read.

update(df)

Shows the trials of df (the trials of the session so far).

add_trials(df: DataFrame) → DataFrame[source]#

Brings the table of trials up to date with df (the trials of the session so far): only the new trials are read. A new session (fewer trials, or another first trial) starts the table again.

update(df: DataFrame) → None[source]#

Shows the trials of df (the trials of the session so far).