arista.viz.adaptation_taus
Adaptation time-constant rainclouds.
Pulls adaptation_fits directly from the DB (already computed during
arista-ingest --process) and renders one figure per adaptation
stimulus, panel per cell type, raincloud per strain.
τ is positively skewed and bounded below at zero, so the y-axis
defaults to a log scale (log_tau=True). Toggle off for a linear
view. Median + IQR per group is read directly off the boxplot at the
centre of each raincloud — bootstrap CI of the median is not
shown here because each cell contributes a single τ value, not a
distribution that benefits from re-sampling.
Functions
Stimuli that produced |
|
|
Per-recording τ values joined with v_recordings metadata. |
|
Raincloud of adaptation τ per strain × cell-type. |
Classes
|
Callable wrapper holding default styling. |
- class arista.viz.adaptation_taus.AdaptationTaus(cell_types=('CC', 'HC'), log_tau=True, figsize=(12, 5), dpi=200, strains=None, rng_seed=19, min_r_squared=None)[source]
Bases:
objectCallable wrapper holding default styling.
- Parameters:
- plot(data, *, stimulus_name=None, title=None, **overrides)[source]
- Parameters:
data (pd.DataFrame | sqlite3.Connection)
stimulus_name (str | None)
title (str | None)
- Return type:
Figure
- arista.viz.adaptation_taus.discover_adaptation_stimuli(conn)[source]
Stimuli that produced
adaptation_fitsrows.- Parameters:
conn (Connection)
- Return type:
- arista.viz.adaptation_taus.fetch_adaptation_taus(conn, *, stimulus_name=None, cell_types=('CC', 'HC'), strains=None, min_r_squared=None)[source]
Per-recording τ values joined with v_recordings metadata.
- Parameters:
conn (Connection) – Open SQLite connection to a populated
arista.db.stimulus_name (str | None) – Optional stimulus filter (one figure per stimulus in the typical batch workflow).
strains (tuple[str, ...] | None) – Optional strain whitelist.
min_r_squared (float | None) – Drop fits below this quality threshold;
Nonekeeps every fit.
- Returns:
DataFrame with one row per recording carrying
recording_id, researcher_name, strain_name, cell_type, hemisphere, stimulus_name, tau_s, amplitude, asymptote, r_squared, n_points.- Return type:
- arista.viz.adaptation_taus.plot_adaptation_taus(data, *, stimulus_name=None, cell_types=('CC', 'HC'), strains=None, log_tau=True, figsize=(12, 5), title=None, rng_seed=19, min_r_squared=None)[source]
Raincloud of adaptation τ per strain × cell-type.
- Parameters:
data (pd.DataFrame | sqlite3.Connection) – Either an already-fetched τ frame (output of
fetch_adaptation_taus()) or a live SQLite connection.stimulus_name (str | None) – Mandatory when
datais a connection.cell_types (tuple[str, ...]) – Cell types to plot, one panel per.
strains (tuple[str, ...] | None) – Optional strain whitelist (display order).
log_tau (bool) – Plot τ on a log y-axis (default). τ is positively skewed and bounded below at zero so log is the natural view; toggle off for a linear inspection.
title (str | None) – Optional figure suptitle.
rng_seed (int) – Seed for the jitter RNG (reproducibility).
min_r_squared (float | None) – Forwarded to
fetch_adaptation_taus().
- Returns:
matplotlib.figure.Figure. Caller owns I/O.- Return type:
Figure