cpm
cpm is a fundamental package for Computational Psychiatry. It is designed to provide a set of tools for researchers and clinicians to analyze and model data in the field of Computational Psychiatry.
Installation and Usage
To install the package, run the following command:
pip install cpm-toolbox
To fit the built-in models many times faster, also install the optional numba dependency, which compiles them; nothing else changes:
pip install "cpm-toolbox[numba]"
Once the package is installed, you can import it in your Python code:
import cpm
Install from GitHub for Nightly Builds
In order to install the package from GitHub, run the following command:
pip install git+https://github.com/DevComPsy/cpm.git
Documentation
The documentation can be viewed here: link.
Citing cpm
If you are using cpm, we recommend citing the titular software paper (Dome et al., 2026):
@article{dome2026cpm,
title = {cpm: {{A}} Python Library for Theory-Driven Modelling in Computational Psychiatry},
author = {Dome, Lenard and Hezemans, Frank H. and Kadri, Kenza and Wagner, Ben J. and Webb, Andrew and Hauser, Tobias U.},
year = 2026,
journal = {PLOS Computational Biology},
volume = {22},
number = {7},
pages = {1--31},
publisher = {Public Library of Science},
doi = {10.1371/journal.pcbi.1014481}
}
Development of documentation
The documentation is built with Sphinx from the docstrings in cpm/ and the pages in docs/.
To build it locally, run the following commands in the root directory:
pip install -e ".[docs]"
python -m sphinx -b html docs docs/_build/html
Then open docs/_build/html/index.html in a browser.
See CONTRIBUTING.md for how to write documentation and tutorials, and for a live preview while you write.
The documentation is published to GitHub Pages by the docs GitHub Actions workflow whenever main changes.
Development process
To work on the toolbox, create a new branch from the main branch. Then, create a pull request to merge the new feature into the main branch. Once the pull request is approved, merge the new feature into the main branch.
Branch naming convention
A git branch should start with a category. Pick one of these: feature, bugfix, hotfix, or test.
featureis for adding, refactoring or removing a featurebugfixis for fixing a bughotfixis for changing code with a temporary solution and/or without following the usual process (usually because of an emergency)testis for experimenting outside of an issue/ticket
See this link for some great description of the naming convention.
Commit message conventions
Please follow the Conventional Commits guidelines for commit messages. Feel free to use gitmoji for commit messages, but insert them at the end of the problem description. See this link for more information.
Pull request conventions
When creating a pull request, make sure to follow these conventions: link
Compiling the package
To compile the package, run the following command in the root directory:
python setup.py sdist bdist_wheel
Uploading the package to PyPi
To upload the package to PyPi, run the following command in the root directory:
twine upload dist/*
Development tools we use
black linterfor python code formattingnumpy-style docstrings for documentationsphinxfor documentation generationpytestfor testing
Metadata
Release files for cpm-toolbox 0.26.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cpm_toolbox-0.26.0.tar.gz | 572.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cpm_toolbox-0.26.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / cpm_toolbox-0.26.0.tar.gz
| Download URL | cpm_toolbox-0.26.0.tar.gz |
|---|---|
| Size | 572.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6ba9ecfa4a65b250499f1f4a16010a381540dbb4db1c856ca31d2417c61c687
|
|
BLAKE2b-256 checksum How to use checksums |
bcb5d0cccab4f173ceb844efeea4456dab00818e672a03cdc539467555fabef0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / cpm_toolbox-0.26.0-py3-none-any.whl
| Download URL | cpm_toolbox-0.26.0-py3-none-any.whl |
|---|---|
| Size | 583.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
147f8c5166dd85d0caec01d12a23c9f8bcd427b486f65db6892d894a218f0055
|
|
BLAKE2b-256 checksum How to use checksums |
b2783fe2a47a8b0eea9d1edbbc6985ec400f622027cb3c192937b20182efd054
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|