Experimental Analysis Examples¶
When you need to process real neural recordings or produce richer visualisations, start with the
examples/experimental_* scripts. They show how to combine
experimental_data, PlotConfig, and
third-party tooling (UMAP, TDA, Numba, …) to build a full analysis pipeline.
experimental_cann1d_analysis.py¶
Location:
examples/experimental_cann1d_analysis.pyData source:
load_roi_data()fetches ROI traces from the Hugging Face cache.Analysis steps:
Run
bump_fits(MCMC) to extract bump parameters frame by frame.Configure
CANN1DPlotConfig.for_bump_animationfor title, frame rate, and brightness limits.Call
create_1d_bump_animationto generate the GIF;nframesand progress-bar settings are optional tweaks.
Output:
bump_analysis_demo.gifand summary statistics in the console.Extensions:
Tune
n_steps/n_roito match your dataset.Without Numba the script falls back to NumPy—watch the startup message if you care about runtime.
experimental_cann2d_analysis.py¶
Location:
examples/experimental_cann2d_analysis.pyData source:
load_grid_data()downloads spike and position data for grid cells.Analysis steps:
Configure
SpikeEmbeddingConfig(smoothing, speed filters) and runembed_spike_trains.Reduce dimensionality with
umap.UMAPand visualise usingplot_projection.Compute persistence with
tda_vis+TDAConfigto validate torus topology.Decode phases via
decode_circular_coordinatesand animate withplot_3d_bump_on_torus.
Output:
experimental_cann2d_analysis_torus.gifand supporting plots.Extensions:
Set
do_shuffle/num_shufflesintda_configfor statistical tests.Use
save_patharguments to archive projections and barcodes.
Tools & dependencies¶
On first run the helpers create
~/.canns/dataand cache downloads automatically.Additional libraries you may need:
umap-learn,canns_lib.ripser(viacanns-lib),numba,matplotlib. Install them with:uv add umap-learn canns-lib numba
PlotConfigandCANN2DPlotConfigacceptshow=Falseso you can render figures on headless servers without changing the code.