Getting Started to Contribute
Getting Started Guide for Contributors¶
Ready to contribute? Here's how to set up CoastSeg for local development. This guide will walk you through the installation process, testing procedures, and best practices for contributing to CoastSeg.
- Make a Fork
Click the fork button located at the top right of the coastseg repository. This will create a fork copy of the coastseg repository that you can edit on your GitHub account. Learn How to Fork from GitHub Docs

-
Clone your fork locally:
-
git clone your fork of coastseg onto your local computer
1git clone https://github.com/your-username/CoastSeg.git -
Create an Anaconda Environment for CoastSeg Development
-
We will install the CoastSeg package and its development dependencies in this environment.
1 | |
- Activate the Conda Environment
1 | |
-
Change Directory to the CoastSeg
-
Go to the location where CoastSeg was installed on your computer.
cd <directory where you have coastseg source code installed>
Example:cd c:\users\CoastSeg1cd CoastSeg -
Install CoastSeg locally as a pip editable installation
1pip install -e . -
This command reads the required dependencies from CoastSeg's
pyproject.tomlfile and installs them within your anaconda environment. - Make sure to run this command in the
CoastSegdirectory that contains thepyproject.tomlfile otherwise this command will fail because pip won't find thepyproject.tomlfile -emeans create an editable install of the package. This will add the files to the python path on your computer making it possible to find the sub directories of the package.See the official documentation.-
.means use the current working directory to install -
Install Geopandas and JupyterLab Locally
1 | |
-
Install the Development Dependencies
1pip install build pytest black -
blackis a python formater that you can run on the code -
pytestis used to automatically run tests on the code -
Create a branch for local development:
1 | |
Now you can make your changes locally.
-
When you're done making changes, use
pytestto check that your changes pass the tests.1 2 3 4
conda activate coastseg_dev cd CoastSeg cd tests pytest . -
Format the code using Black To make your code adhere to python style standards use the
blackcode formatter to automatically format the code. You'll need to change directories to thesrcdirectory, then to the sub directorycoastsegand run theblackhere. If you were to runblackin the main coastseg directory it would not format the code because the code for coastseg is located in directorycoastseg>src>coastseg.
1 2 3 4 | |
-
Commit your changes and push your branch to GitHub:
1git add .1git commit -m "Your detailed description of your changes."1git push origin name-of-your-bugfix-or-feature -
Submit a pull request through the GitHub website.