This Python package provides methods for accessing and analysing data from MalariaGEN.
The malariagen_data Python package is available from the Python
package index (PyPI) and can be installed via pip, e.g.:
pip install malariagen-dataDocumentation of classes and methods in the public API are available from the following locations:
See GitHub releases for release notes.
To get setup for development, see this video and the instructions below.
Fork and clone this repo:
git clone git@github.com:[username]/malariagen-data-python.gitInstall Python, e.g.:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9 python3.9-venvInstall pipx, e.g.:
python3.9 -m pip install --user pipx
python3.9 -m pipx ensurepathInstall poetry, e.g.:
pipx install poetry==1.8.2 --python=/usr/bin/python3.9Create development environment:
cd malariagen-data-python
poetry use 3.9
poetry installActivate development environment:
poetry shellInstall pre-commit and pre-commit hooks:
pipx install pre-commit --python=/usr/bin/python3.9
pre-commit installRun pre-commit checks (isort, black, blackdoc, flake8, ...) manually:
pre-commit run --all-filesRun fast unit tests using simulated data:
poetry run pytest -v tests/anophTo run legacy tests which read data from GCS, you'll need to install the Google Cloud CLI. E.g., if on Linux:
./install_gcloud.shYou'll then need to obtain application-default credentials, e.g.:
./google-cloud-sdk/bin/gcloud auth application-default loginOnce this is done, you can run legacy tests:
poetry run pytest --ignore=tests/anoph -v testsTests will run slowly the first time, as data required for testing will be read from GCS. Subsequent runs will be faster as data will be cached locally in the "gcs_cache" folder.
Create a new GitHub release. That's it. This will automatically trigger publishing of a new release to PyPI and a new version of the documentation via GitHub Actions.
The version switcher for the documentation can then be updated by
modifying the docs/source/_static/switcher.json file accordingly.