CompNeuroVis is a desktop visualization toolkit for computational neuroscience. It is meant for the common lab problem of getting arrays, traces, and compartment morphologies on screen quickly without building a custom GUI from scratch.
Use it to:
- render a 2-D field as an interactive 3-D surface
- link a surface view to a line-plot slice and controls
- view live NEURON or Jaxley compartment activity on morphology and traces
- build a complete custom session with your own solver, controls, and plots
- replay precomputed frames through the same frontend and layout system
Start with CompNeuroVis Docs and especially Getting Started. If you only want the fastest local first run, install the package and launch the static surface example:
pip install -e .
python examples/surface_plot/static_surface_visualizer.pyThe current frontend is a local PyQt6/VisPy desktop app, so examples should be run in a normal GUI session.
Base install:
pip install -e .If you plan to contribute, build the docs site locally, or run the PR-readiness checks, also install the docs/test toolchain:
pip install -e ".[contrib]"If you want matplotlib-backed colormaps such as mpl:viridis or mpl-ramp:...:
pip install -e ".[matplotlib]"Optional simulator backends:
pip install -e ".[neuron]"pip install -e ".[jaxley]"Extras can be combined freely. To install multiple backends, or a backend with contributor tooling:
pip install -e ".[matplotlib,neuron]"
pip install -e ".[neuron,jaxley]"
pip install -e ".[contrib,jaxley]"
pip install -e ".[all]"Choose the path that matches what you want to do first:
python examples/surface_plot/static_surface_visualizer.pyfor the lowest-friction first look with no simulator backend.python examples/surface_plot/surface_cross_section_visualizer.pyfor a linked surface and line-slice workflow.python examples/custom/fitzhugh_nagumo_backend.pyfor a pure customBufferedSessionbackend with its own RK4 solver and explicit scene assembly.python examples/neuron/complex_cell_example.pyfor a live SWC-backed morphology session. Requirespip install -e ".[neuron]".python examples/jaxley/multicell_example.pyfor a live procedurally built multicell example. Requirespip install -e ".[jaxley]".python examples/surface_plot/animated_surface_replay.pyfor replaying precomputed frames through the same frontend model.
On Windows, live session entrypoints use multiprocessing with spawn. run_app(...) handles the spawned-child import case internally so shared scripts can keep the same top-level launch pattern across Windows, Linux, and macOS.
App-scoped diagnostics now live on AppSpec(diagnostics=DiagnosticsSpec(...)).
That is the preferred cross-platform way to turn on timestamped perf logs.
Environment variables remain available as fallback overrides when you are
debugging without touching code.
Use the published docs for the guided path:
- Docs home
- Getting started for installation and first-run paths
- Tutorials for adapting examples into your own code
- Concept docs for the stable mental model
- Architecture docs for implementation detail and protocol structure
- API reference for the public authoring surface
- Example index for runnable examples
If you are browsing the repo directly instead of the published site, the same
material also lives under docs/.
Serve the docs site locally:
python -m mkdocs serveBuild the docs site in strict mode:
python -m mkdocs build --strictPublished docs deploy from .github/workflows/docs-pages.yml to
CompNeuroVis Docs.
You do not need the full architecture to run an example, but the core model is small:
Field: labeled numeric data with named axes and coordinatesScene: the fields, geometries, views, controls, and layout shown in the appSession: an optional live or replay backend that emits updates over timeDiagnosticsSpec: optional app-scoped diagnostics such as perf loggingrun_app(...): launches the current VisPy frontend for anAppSpec
The main package exports the core types, builders, and frontend entrypoint:
Field,Scene,MorphologyGeometry,GridGeometryMorphologyViewSpec,SurfaceViewSpec,LinePlotViewSpec,StateGraphViewSpecAppSpec,DiagnosticsSpecControlSpec,ScalarValueSpec,ChoiceValueSpec,BoolValueSpec,XYValueSpec,ControlPresentationSpec,ActionSpecNeuronSession,JaxleySession,ReplaySessionHistoryCaptureMode,grid_fieldbuild_neuron_app,build_jaxley_app,build_surface_app,build_replay_apprun_app
Backend-specific session classes and builders are conditional exports: install the matching backend extra first when you want to use NeuronSession, JaxleySession, build_neuron_app(...), or build_jaxley_app(...).
build_neuron_app(...) and build_jaxley_app(...) are current convenience helpers for backend-backed workflows, not the intended long-term conceptual boundary of the library. The long-term direction is a feature-composable public API over the same shared core model.
If you are editing the repo rather than consuming the published docs:
AGENTS.mdis the canonical machine-readable entrypoint for humans and toolsdocs/architecture/contains architecture and protocol notesdocs/concepts/contains stable conceptual primitivesdocs/tutorials/contains builder- and use-case-oriented walkthroughsdocs/reference/contains generated repo/API/example/skill indexesskills/contains repo-owned task skills
Generate the reference indexes with:
python scripts/generate_indexes.pymcp.json at the repo root is the canonical list of MCP servers for this project. Agent-specific config files (.claude/settings.json, .vscode/mcp.json, .cursor/mcp.json, .codex/config.toml, .gemini/settings.json, opencode.json) are generated from it and committed alongside it. Do not edit them directly.
For portability, the generator may adapt local stdio launch commands in agent-specific outputs. In particular, npx-backed servers are wrapped so the generated configs still launch correctly on Windows.
If you add, remove, or change a server, edit mcp.json and regenerate:
python scripts/generate_mcp_configs.pyHuman contributors can use the same PR-readiness checks without an agent:
- Install contributor dependencies with
pip install -e ".[contrib]". - Run
python scripts/pr_readiness.py checkwhile iterating locally. This runs the repo quality gate, including architecture invariants, packaging metadata validation, generated MCP config validation,pytest, compile checks, generated index validation, and the strict MkDocs build. - Commit your implementation changes normally.
- As the last commit before you push to
mainor open a PR, runpython scripts/pr_readiness.py seal --commit.
seal --commit does not replace your normal code or docs commits. It reruns the readiness checks, writes a commit-keyed receipt under .compneurovis/pr-readiness/, and adds one final attestation commit automatically.
If you change code, docs, tests, examples, or skills after sealing, run python scripts/pr_readiness.py seal --commit again from the new final implementation commit.
GitHub Actions verifies the sealed tip on pull request heads and on pushes to main.
Use CHANGELOG.md as the canonical release history and GitHub Releases as the published wrapper around a tagged commit.
Recommended release flow:
- Keep current work under
## UnreleasedinCHANGELOG.md. - When cutting a release, move those notes into a new version section and update pyproject.toml to the same version.
- Run
python scripts/pr_readiness.py check. - Commit the release-prep changes.
- Run
python scripts/pr_readiness.py seal --commit. - Tag that sealed final commit, for example
git tag v0.2.0. - Push the branch and tag, then create a GitHub Release from that tag using the matching changelog section as the release notes.
The detailed repo workflow lives in docs/architecture/release-process.md.