Installation
The easiest way to install is:
pip install dit
If you want to install dit within a conda environment, you can simply do:
conda install -c conda-forge dit
Optional features are grouped into extras:
Extra |
Provides |
|---|---|
|
matplotlib (plots), plotly (interactive plots), colorama (colored PID tables), numdifftools (numerical gradients/Hessians), pint (units), pycddlib-standalone + pypoman (polytope vertex enumeration), scikit-learn (fast nearest-neighbor estimators) |
|
JAX optimization backend with autodiff (jax, jaxlib, optimistix, slsqp-jax) |
|
PyTorch optimization backend with autodiff and GPU support |
|
PyTensor optimization backend with autodiff |
|
sympy-valued (symbolic) distributions |
|
ECOS cone solver for the BROJA partial information decomposition |
|
music21, for the empirical Bach / Corelli example distributions |
|
pytest, hypothesis, and plugins for running the test suite |
|
Sphinx and friends for building the documentation |
|
everything above, plus ruff and ty |
For example:
pip install "dit[optional,jax]"
For development, we recommend uv:
git clone https://github.com/dit/dit.git
cd dit
uv sync --extra dev
This installs dit in editable mode with all development dependencies
(tests, docs, linting, type checking, and optional backends).
Testing
# Using uv (recommended)
uv run pytest
# Or with pip
pip install -e ".[test]"
pytest
By default the test suite skips tests marked slow and very_slow. To run
them as well, override the marker selection:
uv run pytest -m ""
Building the documentation
uv run sphinx-build -W --keep-going -b html docs docs/_build/html