Thank you for your interest in contributing to MorphoClass!
Before you open an issue or start working on a pull request, please make sure to read the following guidelines.
Before you submit an issue, please search our issue tracker to verify if any similar issue was raised in the past. Even if you cannot find a direct answer to your question, this can allow you to collect a list of related issues that you can link in your new issue.
Once you have verified that no similar issues exist yet, feel free to open a new issue.
Our extended documentation on https://morphoclass.readthedocs.io has a dedicated installation section that will guide you through a development installation of MorphoClass. Please follow it to prepare your environment.
When working on the code please keep the following points in mind:
- enable pre-commit (
pre-commit install
) - use
black
andisort
to auto-formatpre-commit
should normally do that for you automatically- check via
tox -e lint
(also runsflake8
) - trigger formatting for all files via
tox -e format
- apply PEP8, check via
tox -e lint
- adding type annotations is preferred, use
tox -e type
for checking - re-generate the API docs for new modules via
tox -e apidoc
, check usingtox -e apidoc-check
- write unit tests, test by running
pytest tests
in the project root - add docstrings (NumPy style)
- work on branches, don't push to
main
.
If you wish to contribute to the code base, opening a pull request on GitHub is the right thing to do!
Please read the following paragraphs to make sure that your work can be considered for a potential integration in our source code.
In general, every pull request should refer to a specific issue. If you would like to provide your contribution to an untracked issue, please create first an issue as explained here so that we can discuss the value of the proposed contribution and its implementation.
Concerning CI tests, we are running various checks on linting, unit tests, docs, and packaging. If you are adding or modifying a functionality in the code, you are also expected to provide a unit test demonstrating and checking the new behavior.
We are gradually introducing type annotations to our code, and our CI performs type checking with mypy. If your PR introduces a new function or heavily modifies an existing function, you should also add type annotations for such function.
If your PR introduces a dependency on a new python package, this should be
added to both the setup.py
and the requirements.txt
files.
We use GitHub Actions to run our CI
tests.
Once you open a PR, the workflow that runs all CI tests is automatically
triggered. This workflow is also triggered every time a new commit is pushed to
that PR branch. If you want to push a commit without triggering the CI tests
(e.g. if a feature is still work in progress, and you want to save time), your
commit message should include an appropriate label like [skip ci]
, [ci skip]
, [no ci]
etc. (see
here
for the complete list).
All CI tests must pass before the pull request can be considered for review.
Once you have satisfied all the previous points, feel free to open your pull request!
We will get back to you as soon as possible with comments and feedback in the format of pull request reviews. A positive review from one of the maintainers is required for the pull request to be merged into the master.