Metadata-Version: 2.4
Name: compneurovis
Version: 0.4.0
Summary: Interactive visualization toolkit for computational neuroscience simulations and data
License: Apache-2.0
License-File: LICENSE
Author: Orren Ravid
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Provides-Extra: all
Provides-Extra: contrib
Provides-Extra: jaxley
Provides-Extra: matplotlib
Provides-Extra: neuron
Provides-Extra: notebook
Requires-Dist: PyOpenGL (==3.1.10)
Requires-Dist: PyQt6 (==6.9.1)
Requires-Dist: anywidget (>=0.11,<0.12) ; extra == "notebook" or extra == "all"
Requires-Dist: cloudpickle (>=3.1,<4.0) ; extra == "notebook" or extra == "all"
Requires-Dist: ipywidgets (>=8.1,<9.0) ; extra == "notebook" or extra == "all"
Requires-Dist: jaxley (>=0.1,<0.2) ; extra == "jaxley" or extra == "all"
Requires-Dist: matplotlib (>=3.10,<4.0) ; extra == "matplotlib" or extra == "all"
Requires-Dist: mkdocs (>=1.6.1,<2.0.0) ; extra == "contrib" or extra == "all"
Requires-Dist: mkdocs-material (>=9.7.6,<10.0.0) ; extra == "contrib" or extra == "all"
Requires-Dist: neuron (>=8.2,<9.0) ; extra == "neuron" or extra == "all"
Requires-Dist: numpy (>=1.20)
Requires-Dist: pyqtgraph (==0.13.7)
Requires-Dist: pytest (>=7.0,<8.0) ; extra == "contrib" or extra == "all"
Requires-Dist: ruff (>=0.4,<0.5) ; extra == "contrib" or extra == "all"
Requires-Dist: scipy (==1.16.0)
Requires-Dist: vispy (==0.15.2)
Project-URL: Repository, https://github.com/orrenravid1/CompNeuroVis
Description-Content-Type: text/markdown

# CompNeuroVis

CompNeuroVis connects computational neuroscience simulations and data to
interactive desktop visualizations. Sources expose model data and controls;
views opt into line plots, morphology, surfaces, and other panels; cnv.show()
integrates those pieces into one application.

## Release Status

CompNeuroVis 0.4.0 is the first stable release. Until 1.0.0, public APIs may
still change between minor releases; changes are recorded in the changelog.

This release supports the inline source workflow used by current examples.
Notebook, distributed, and multi-source composition paths remain experimental.

## Installation

CompNeuroVis requires Python 3.11.

Install the latest release:

~~~bash
pip install compneurovis
~~~

Install current checkout:

~~~bash
pip install -e .
~~~

Install optional simulator integrations:

~~~bash
pip install -e ".[neuron]"
pip install -e ".[jaxley]"
~~~

Notebook dependencies are experimental:

~~~bash
pip install -e ".[notebook]"
~~~

## Minimal App

~~~python
import math

import compneurovis as cnv


state = {"time_ms": 0.0, "frequency_hz": 1.0}


def step(ctx):
    state["time_ms"] += 16.0


def set_frequency(ctx, value):
    state["frequency_hz"] = float(value)


src = cnv.source(step)

wave = src.line(
    "Sine wave",
    read=lambda: math.sin(
        2.0
        * math.pi
        * state["frequency_hz"]
        * state["time_ms"]
        / 1000.0
    ),
    x=lambda: state["time_ms"],
    y_min=-1.1,
    y_max=1.1,
)

src.slider(
    "frequency_hz",
    label="Frequency (Hz)",
    get=lambda: state["frequency_hz"],
    set=set_frequency,
    min=0.1,
    max=5.0,
)

cnv.layout(((wave,), (src.controls_panel,)))
cnv.show(title="Sine wave")
~~~

Run repository version:

~~~bash
python examples/custom/sine_wave.py
~~~

## NEURON Morphology

NEURON sources keep simulator-specific data collection optimized while using
the same line, control, layout, and show API.

~~~python
from neuron import h

import compneurovis as cnv


soma = h.Section(name="soma")
soma.L = soma.diam = 20.0
soma.insert("hh")

stim = h.IClamp(soma(0.5))
stim.delay = 100.0
stim.dur = 5.0
stim.amp = 0.8


def set_stimulus(ctx, value):
    stim.amp = float(value)


src = cnv.neuron.source(
    sections=[soma],
    dt=0.025,
    display_dt=0.5,
)

morphology = src.morphology(
    variable="v",
    name="Membrane voltage",
    unit="mV",
    color_limits=(-80.0, 50.0),
    selected="soma@0.50000",
)

voltage = src.line(
    "Selected voltage",
    source=morphology.selection,
    y_unit="mV",
    rolling_window=500.0,
)

src.slider(
    "stimulus",
    label="Stimulus amplitude (nA)",
    get=lambda: stim.amp,
    set=set_stimulus,
    min=0.0,
    max=2.0,
)

cnv.layout(((morphology, voltage), (src.controls_panel,)))
cnv.show(title="NEURON morphology")
~~~

Full showcase:

~~~bash
python examples/neuron/complete_interface.py
~~~

Static surface showcase:

~~~bash
python examples/widgets/surface.py
~~~

## Supported Surface

- cnv.source(...) for Python callables, iterators, and static data.
- cnv.neuron.source(...) and cnv.jaxley.source(...) for simulator-native sources.
- Source-level line, bar, morphology, and surface views.
- Typed controls, buttons, and hotkeys used by current examples.
- cnv.layout(...) for single-app panel placement.
- cnv.show(...) with VisPy and PyQt6 desktop rendering.

Views are opt-in. A simulator source can own morphology without displaying a
morphology panel.

## Experimental

These paths are incomplete or not release-supported:

- Notebook frontends and notebook process lifecycle.
- Remote sources and remote actors.
- Source composition and independent multi-source execution.
- Multi-source custom layouts.
- Advanced callback access through backend internals.

Incomplete distributed entrypoints live under cnv.experimental so they are not
mistaken for supported root-level API.

## Documentation

Start with [Getting Started](docs/getting-started.md), then follow the ordered
[Example Path](docs/examples.md). To add an app-local or distributable widget, use
[Third-Party Widget Authoring](docs/widget-authoring.md).

Build the documentation site locally:

~~~bash
python -m mkdocs build --strict
~~~

## License

Apache License 2.0.

