Skip to main content
Dendra

PyTorch Python Code style: Ruff

Dendra is a differentiable biophysical neuron and network simulator built on PyTorch. It supports CPU and GPU execution, extracellular fields, event-based networks, and macroscopic descriptors for gradient-based model training.

Documentation

The complete documentation is published at wmglab-duke.github.io/dendra. Start with the installation guide, then see the tutorials and the unit conventions. The examples provide runnable scripts grouped by task, from simulation and recording to training and custom model components.

Installation

Dendra requires Python 3.11 or newer and PyTorch 2.14 or newer. On Windows, install inside WSL2 because the required NEURON dependency does not publish native Windows wheels on PyPI.

Install Dendra with the recommended native CPU solvers:

python -m pip install --upgrade pip
python -m pip install --only-binary=dendra-solvers "dendra[solvers]"

The solvers extra installs dendra-solvers, which provides native CPU solvers for block and tree models. If a compatible solver wheel is unavailable, install the base package:

python -m pip install dendra

The base package retains Dendra's PyTorch CPU solver for unbranched cables and all GPU solvers. To select a particular CPU, CUDA, or ROCm build, install PyTorch first using its installation selector, then install Dendra.

For interactive Matplotlib figures in Jupyter, install the Jupyter extra:

python -m pip install "dendra[jupyter]"

Verify the installed dependencies and inspect the deployment environment:

python -m pip check
python -m dendra doctor

The installation guide explains solver-wheel support, source installations, upgrades, and Jupyter setup. For CUDA deployment checks, see the GPU deployment guide.

Development

The contribution guide describes development setup and the GitHub pull-request workflow. The testing and code coverage guide covers the CPU, NEURON, CUDA, sanitizer, and coverage lanes.

Citation

A citation for Dendra and its accompanying manuscript will be added when it is available. Please also consider citing the work where geometric and topological surrogates and gradient-based design of selective neurostimulation are discussed in detail:

Minhaj A. Hussain, Warren M. Grill, Nicole A. Pelot. "Highly efficient modeling and optimization of neural fiber responses to electrical stimulation." Nature Communications. 2024. doi:10.1038/s41467-024-51709-8

@article{hussain_highly_2024,
    title = {Highly efficient modeling and optimization of neural fiber responses to electrical stimulation},
    doi = {10.1038/s41467-024-51709-8},
    journal = {Nature Communications},
    author = {Hussain, Minhaj A. and Grill, Warren M. and Pelot, Nicole A.},
    year = {2024}
}

License

Dendra's original code is distributed under Duke University's custom license for non-commercial research and academic testing. Commercial use, including industrially sponsored research, requires a separate agreement with Duke's Office for Translation and Commercialization. The license sets out those terms; downloading, cloning, or forking the software constitutes acceptance of the agreement. Identified third-party portions retain their upstream terms; see the third-party notices.

Metadata

Release files for dendra 0.28.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dendra 0.28.0
File Size Uploaded Provenance Actions
dendra-0.28.0.tar.gz 2.4 MB With provenance Details for dendra-0.28.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dendra 0.28.0
File Interpreter ABI Platform Actions
dendra-0.28.0-py3-none-any.whl Python 3 none any Details for dendra-0.28.0-py3-none-any.whl

Total release size: 4.2 MB

Release files / dendra-0.28.0.tar.gz

Download URL dendra-0.28.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
5348288b40b348612b9db49b9f0f5b244100f47576cf210fbee791c80d6563f2
BLAKE2b-256 checksum
How to use checksums
078148c53419f847b261a1456fa41254d65a54b4e5f60e6b56f169d2ab8e0681
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / dendra-0.28.0-py3-none-any.whl

Download URL dendra-0.28.0-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ebbbec6fb3c1b494933521527ca03e09f12d423402cba0cae367b99a3a981be3
BLAKE2b-256 checksum
How to use checksums
0abe04487e1494314686cfa44eb23178bf68ecb637a4355a72164a2ced7ea21b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for dendra 0.28.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dendra-0.28.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page