Contribute to PlantSeg¶
PlantSeg is an open-source project, and we welcome contributions from the community. There are many ways to contribute, such as writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests, or writing code that can be incorporated into PlantSeg itself.
Install Mamba¶
The easiest way to install PlantSeg is by using mamba (Miniforge) package manager. If you don't have conda already, install it:
To download Miniforge open a terminal and type:
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh
Then install by typing:
bash Miniforge3-$(uname)-$(uname -m).sh
and follow the installation instructions.
Please refer to the Miniforge repo for more information, troubleshooting and uninstallation instructions.
The miniforge installation file Miniforge3-*.sh
can be deleted now.
The first step required to use the pipeline is installing mamba. The installation can be done by downloading the installer from the Miniforge repo. There you can find the download links for the latest version of Miniforge, troubleshooting and uninstallation instructions.
Getting Started¶
To set up the development environment, run:
conda env create -f environment-dev.yaml
conda activate plant-seg-dev
This installs PlantSeg using pip --editable .
and all dependencies using conda. (Some dependencies are only available through conda-forge)
Hierarchical Design of PlantSeg¶
Please refer to Python API.
Coding Style¶
PlantSeg uses Ruff for linting and formatting. Ruff is compatible with Black for formatting.
To ensure proper formatting and commit messages, pre-commit is used. This runs on PRs automatically, to run it locally check out Pre-commit.
Before Submitting a Pull Request¶
Run Tests with pytest
¶
Ensure that pytest
is installed in your conda environment. To run the tests, simply use:
pytest
Check Syntax with pre-commit
¶
The PlantSeg repository uses pre-commit hooks to ensure the code is correctly formatted and free of linting issues. While not mandatory, it is encouraged to check your code before committing by running:
pre-commit run --all-files
Commit messages are important. Please follow the Conventional Commits specification.
For efficiency, pytest is not included in the pre-commit hooks. Please run the tests separately.