|
| 1 | +# Contributing to `motile` |
| 2 | + |
| 3 | +:tada: Thank you for your interest in contributing to `motile`! :tada: |
| 4 | + |
| 5 | +`motile` is a research library. While it is stable and in use in multiple projects, the time |
| 6 | +available for the core developers to perform maintenance and feature requests is limited. |
| 7 | +The preferred form of communication for bugs and requests is GitHub |
| 8 | +[Issues](https://github.com/funkelab/motile/issues/new) - if your issue does not get a |
| 9 | +response in a reasonable time, feel free to ping @cmalinmayor and I will take at least a quick look. |
| 10 | + |
| 11 | +## New Costs and Constraints |
| 12 | +To keep this library manageable to maintain, we intentionally keep the number of `Variables`, |
| 13 | +`Costs`, and `Constraints` implemented here low, and highly encourage people with specific |
| 14 | +needs to extend the base classes to implement their own components within the `motile` |
| 15 | +framework. |
| 16 | + |
| 17 | +Examples of complex workflows can be found in experimental libraries that use `motile`, such as: |
| 18 | +- [`attrackt`](https://github.com/funkelab/attrackt) |
| 19 | +- [`mhat` (Multi Hypothesis Affinity Tracking)](https://github.com/funkelab/mhat) |
| 20 | + |
| 21 | +If you want to contribute a `Cost` or `Constraint` that is widely useful and should be part of |
| 22 | +the core library, please open an [Issue](https://github.com/funkelab/motile/issues/new) or PR and we will review it. If we can't |
| 23 | +commit to maintaining the code but think others can use it as inspiration, we might suggest |
| 24 | +contributing it to the [`motile_toolbox`](https://github.com/funkelab/motile_toolbox) instead. |
| 25 | + |
| 26 | +## Development Tools |
| 27 | + |
| 28 | +We use `uv` for dependency management, `ruff` for formatting and linting, and `mypy` for type checking. |
| 29 | +If set up correctly, the `pre-commit` configuration runs `ruff` and `mypy` before each commit. |
| 30 | +To set it up, navigate to the root directory of this repository and run: |
| 31 | +```bash |
| 32 | +uv run pre-commit install |
| 33 | +``` |
| 34 | + |
| 35 | +To run the tests from the root directory: |
| 36 | +```bash |
| 37 | +uv run pytest |
| 38 | +``` |
| 39 | + |
| 40 | +### Deployment |
| 41 | + |
| 42 | +To deploy a new version, first make sure to bump the version string in |
| 43 | +`motile/__init__.py`. Then create an **annotated** tag, and push it to GitHub. |
| 44 | +This will trigger the `deploy.yaml` workflow to upload to PyPI |
| 45 | + |
| 46 | +```bash |
| 47 | +git tag -a vX.Y.Z -m vX.Y.Z |
| 48 | +git push upstream --follow-tags |
| 49 | +``` |
| 50 | + |
| 51 | +### Building Documentation |
| 52 | +From root directory of the repository: |
| 53 | +```sh |
| 54 | +uv run make docs |
| 55 | +open docs/_build/html/index.html |
| 56 | + |
| 57 | +# or to start a live-reloading server |
| 58 | +uv run make docs-watch |
| 59 | +``` |
0 commit comments