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

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.2
File Size Uploaded Provenance Actions
dendra-0.28.2.tar.gz 2.4 MB With provenance Details for dendra-0.28.2.tar.gz

Built distribution (wheel)

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

Total release size: 4.2 MB

Release files / dendra-0.28.2.tar.gz

Download URL dendra-0.28.2.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
918d068ab5d7d51492d0c5acf16ea7ba8415e2ef7942fb1b64e50f43482258d5
BLAKE2b-256 checksum
How to use checksums
bb44980e7799efad5f3a09158eb9da97076b05d923ecfb56cae8724a810a5305
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 11, 2026.

Transparency log

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

Download URL dendra-0.28.2-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ce5a35eb9f33ed31e812daa765592baf08fbe92ddf7340d6bfa031ea428f68c8
BLAKE2b-256 checksum
How to use checksums
24e146fa767320c07107b384336dd8049de680f5dc574cc24b86d0e0047e3d80
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 11, 2026.

Transparency log

Security for dendra 0.28.2

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.2.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 11, 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