Skip to main content
Dendra

PyTorch Python Code style: Ruff

Dendra is a differentiable biophysical neuron and network simulator built on PyTorch. Run simulations on CPUs, GPUs (tested with NVIDIA CUDA), or Apple Silicon (Metal via PyTorch MPS). Dendra supports 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, we recommend using WSL2.

Install Dendra with the recommended native CPU and Apple Metal 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 and native Metal solvers for supported MPS models. If a compatible solver wheel is unavailable, install the base package:

python -m pip install dendra

The base package includes a PyTorch CPU solver for unbranched cables and Dendra's Triton GPU solvers. To select a particular build, install PyTorch using its installation selector before installing Dendra. AMD GPU compatibility with ROCm is unverified.

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. See Apple Silicon setup for MPS device selection and Metal solver checks, or CUDA deployment for NVIDIA runtime checks.

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.30.1

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.30.1
File Size Uploaded Provenance Actions
dendra-0.30.1.tar.gz 2.5 MB With provenance Details for dendra-0.30.1.tar.gz

Built distribution (wheel)

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

Total release size: 4.4 MB

Release files / dendra-0.30.1.tar.gz

Download URL dendra-0.30.1.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
f90feab70b4e8a64c61c471cb3ec55a2c1511793597b5c0fd41a34ab8ba83525
BLAKE2b-256 checksum
How to use checksums
5623833f9c12ed55f3890120664ba5128008e5e729525515edf176cde1543e6d
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 26, 2026.

Transparency log

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

Download URL dendra-0.30.1-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
893fef86cf493a0d27be1cf072643d0fdb021e3f0bb0de7eb4cb4286703ea1b5
BLAKE2b-256 checksum
How to use checksums
2202b89de03aef874d35179f8eb4b18dd18493cc06ca00aba0a4d4a0cb635136
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 26, 2026.

Transparency log

Security for dendra 0.30.1

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.30.1.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 26, 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