Skip to content

Commit dd691e3

Browse files
authored
Improved contributing guidelines (#169)
1 parent 47d16a3 commit dd691e3

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ The Segment Anything Model is computationally intensive, and a powerful GPU is r
9292

9393
This repository and its content are provided for educational purposes only. By using the information and code provided, users acknowledge that they are using the APIs and models at their own risk and agree to comply with any applicable laws and regulations. Users who intend to download a large number of image tiles from any basemap are advised to contact the basemap provider to obtain permission before doing so. Unauthorized use of the basemap or any of its components may be a violation of copyright laws or other applicable laws and regulations.
9494

95+
## Contributing
96+
97+
Please refer to the [contributing guidelines](https://samgeo.gishub.org/contributing) for more information.
98+
9599
## Acknowledgements
96100

97101
This project is based upon work partially supported by the National Aeronautics and Space Administration (NASA) under Grant No. 80NSSC22K1742 issued through the [Open Source Tools, Frameworks, and Libraries 2020 Program](https://bit.ly/3RVBRcQ).

docs/contributing.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,27 @@ Ready to contribute? Here's how to set up segment-geospatial for local developme
9999
100100
Before you submit a pull request, check that it meets these guidelines:
101101
102-
1. The pull request should include tests.
102+
1. The pull request should include tests (see the section below - [Unit Testing](https://samgeo.gishub.org/contributing/#unit-testing)).
103103
2. If the pull request adds functionality, the docs should be updated.
104104
Put your new functionality into a function with a docstring, and add
105-
the feature to the list in README.rst.
105+
the feature to the list in README.md.
106106
3. The pull request should work for Python 3.8, 3.9, 3.10, and 3.11. Check <https://github.com/giswqs/segment-geospatial/pull_requests> and make sure that the tests pass for all
107107
supported Python versions.
108+
109+
## Unit Testing
110+
111+
Unit tests are in the `tests` folder. If you add new functionality to the package, please add a unit test for it. You can either add the test to an existing test file or create a new one. For example, if you add a new function to `samgeo/samgeo.py`, you can add the unit test to `tests/test_samgeo.py`. If you add a new module to `samgeo/<MODULE-NAME>`, you can create a new test file in `tests/test_<MODULE-NAME>`. Please refer to `tests/test_samgeo.py` for examples. For more information about unit testing, please refer to this tutorial - [Getting Started With Testing in Python](https://realpython.com/python-testing/).
112+
113+
To run the unit tests, navigate to the root directory of the package and run the following command:
114+
115+
```bash
116+
python -m unittest discover tests/
117+
```
118+
119+
## Add new dependencies
120+
121+
If you PR involves adding new dependencies, please make sure that the new dependencies are available on both [PyPI](https://pypi.org/) and [conda-forge](https://conda-forge.org/). Search [here](https://conda-forge.org/feedstock-outputs/) to see if the package is available on conda-forge. If the package is not available on conda-forge, it can't be added as a required dependency in `requirements.txt`. Instead, it should be added as an optional dependency in `requirements_dev.txt`.
122+
123+
If the package is available on PyPI and conda-forge, but if it is challenging to install the package on some operating systems, we would recommend adding the package as an optional dependency in `requirements_dev.txt` rather than a required dependency in `requirements.txt`.
124+
125+
The dependencies required for building the documentation should be added to `requirements_docs.txt`. In most cases, contributors do not need to add new dependencies to `requirements_docs.txt` unless the documentation fails to build due to missing dependencies.

0 commit comments

Comments
 (0)