Clone moscot from source as:
git clone https://github.com/theislab/moscot cd moscot git checkout main
Install the test and development mode:
pip install -e'.[dev,test]'
Optionally install pre-commit. This will ensure that the pushed code passes the linting steps:
pre-commit install
Although the last step is not necessary, it is highly recommended, since it will help you to pass the linting step (see Code style guide). If you did install pre-commit but are unable to decipher some flags, you can still commit using the --no-verify.
The moscot project:
Tests structure:
We rely on black and isort to do the most of the formatting - both of them are integrated as pre-commit hooks. You can use tox to check the changes:
tox -e lint-code
Furthermore, we also require that:
We use tox to automate our testing, as well as linting and documentation creation. To run the tests, run:
tox -e py{310,311}-{linux,macos}
depending on the Python version(s) in your PATH and your operating system. We use flake8 and mypy to further analyze the code. Use # noqa: <error1>,<error2> to ignore certain flake8 errors and # type: ignore[error1,error2] to ignore specific mypy errors.
To run only a subset of tests, run:
tox -e <environment> -- <name>
where <name> can be a path to a test file/directory or a name of a test function/class. For example, to run only the tests in the plotting module, use:
tox -e py310-linux -- tests/plotting/test_plotting.py
If needed, a specific tox environment can be recreated as:
tox -e <environment> --recreate
We use numpy-style docstrings for the documentation with the following additions and modifications:
In order to build the documentation, run:
tox -e build-docs
Since the tutorials are hosted on a separate repository (see Writing tutorials/examples), we download the newest tutorials/examples from there and build the documentation here.
To validate the links inside the documentation, run:
tox -e lint-docs
If you need to clean the artifacts from previous documentation builds, run:
tox -e clean-docs
Tutorials and examples are hosted on a separate repository called moscot_notebooks. Please refer to this guide for more information.
Before submitting a new pull request, please make sure you followed these instructions: