How cortex-lab/phylib works
Project type and purpose
• phylib is a domain‑specific Python library (not a full‑stack app) for electrophysiological data analysis.
• It provides core building blocks for higher‑level tools (phy, ibllib), offering I/O, electrode definitions, statistical routines, and utilities.
File structure
• Top‑level:
• setup.py, requirements*.txt, environment.yml → packaging and dependencies
• Makefile, .travis.yml → CI/build scripts
• phylib/ → core code; subdivided into four major packages + tests alongside each
• phylib/electrode → electrode models, probe definitions (e.g. 1x32_buzsaki.prb), measurement arrays (mea.py)
• phylib/io → reading and merging data from different formats (ALF, array, datasets, traces), mock data generators
• phylib/stats → statistical analyses (cross‑correlograms, clustering)
• phylib/utils → miscellaneous helpers (geometry, event handling, type definitions)
• Each package has a tests/ subpackage verifying its functionality.
README for additional insights
• Emphasizes that phylib is a supporting library for spike‑sorting visualization (phy) and behavioural‑neuro pipeline (ibllib).
Final advice
• Be detailed: break each phylib subpackage into its responsibilities.
• Both the static structure (packages, files) and dynamic flow (data paths, API calls).
• Don’t overthink: representing each module and its major interactions is sufficient to give stakeholders a clear view of phylib’s architecture.