Requires Python 3.9 or later.
From PyPI¶
pip install dapiIn a Jupyter notebook¶
%pip install dapi --quietCheck version¶
import dapi
print(dapi.__version__)Update¶
pip install --upgrade dapiDevelopment¶
Install the dev branch¶
To test unreleased features from the dev branch:
pip install git+https://github.com/DesignSafe-CI/dapi.git@devOr in a DesignSafe Jupyter notebook:
%pip uninstall dapi --yes
%pip install git+https://github.com/DesignSafe-CI/dapi.git@dev --quietRestart the kernel after installing.
Local editable install¶
For local development where changes take effect immediately:
git clone https://github.com/DesignSafe-CI/dapi.git
cd dapi
git checkout dev
pip install -e .Pre-commit hook¶
The repo includes a pre-commit hook that auto-formats code with ruff format and blocks commits that fail ruff check:
cp scripts/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commitRunning tests¶
pip install pytest
pytest tests/ -vLinting¶
ruff format --check .
ruff check .To auto-fix lint errors:
ruff check --fix .