|
| 1 | +# Contributing to gwlearn |
| 2 | + |
| 3 | +First off, thanks for taking the time to contribute! ❤️ |
| 4 | + |
| 5 | +All types of contributions are encouraged and valued. See the this document for |
| 6 | +different ways to help and details about how this project handles them. Please make sure |
| 7 | +to read the relevant section before making your contribution. It will make it a lot |
| 8 | +easier for us maintainers and smooth out the experience for all involved. The community |
| 9 | +looks forward to your contributions. 🎉 |
| 10 | + |
| 11 | +> And if you like the project, but just don't have time to contribute, that's fine. |
| 12 | +> There are other easy ways to support the project and show your appreciation, which we |
| 13 | +> would also be very happy about: - Star the project - Tweet about it - Refer this |
| 14 | +> project in your project's readme - Mention the project at local meetups and tell your |
| 15 | +> friends/colleagues |
| 16 | +
|
| 17 | +## I Have a Question |
| 18 | + |
| 19 | +> If you want to ask a question, we assume that you have read the available |
| 20 | +> [Documentation](https://pysal.org/gwlearn). |
| 21 | +
|
| 22 | +Before you ask a question, it is best to search for existing |
| 23 | +[Issues](https:/github.com/pysal/gwlearn/issues) that might help you. In case you have |
| 24 | +found a suitable issue and still need clarification, you can write your question in this |
| 25 | +issue. It is also advisable to search the internet for answers first. |
| 26 | + |
| 27 | +If you then still feel the need to ask a question and need clarification, we recommend |
| 28 | +the following: |
| 29 | + |
| 30 | +- Open an [Issue](https:/github.com/pysal/gwlearn/issues/new). |
| 31 | +- Provide as much context as you can about what you're running into. |
| 32 | +- Provide project and platform versions, depending on what seems relevant. |
| 33 | + |
| 34 | +We will then take care of the issue as soon as possible. |
| 35 | + |
| 36 | +### Discord |
| 37 | + |
| 38 | +You may also want to join [PySAL Discord server](https://discord.gg/BxFTEPFFZn) and ask |
| 39 | +your question there. Just note, that Discord is primarily for ephemeral developer |
| 40 | +discussion and every question others may benefit from shall be asked publicly on GitHub. |
| 41 | + |
| 42 | +### Reporting Bugs |
| 43 | + |
| 44 | +<!-- omit in toc --> |
| 45 | +#### Before Submitting a Bug Report |
| 46 | + |
| 47 | +A good bug report shouldn't leave others needing to chase you up for more information. |
| 48 | +Therefore, we ask you to investigate carefully, collect information and describe the |
| 49 | +issue in detail in your report. Please complete the following steps in advance to help |
| 50 | +us fix any potential bug as fast as possible. |
| 51 | + |
| 52 | +- Make sure that you are using the latest version. |
| 53 | +- Determine if your bug is really a bug and not an error on your side e.g. using |
| 54 | + incompatible environment components/versions (Make sure that you have read the |
| 55 | + [documentation](https://pysal.org/gwlearn).) |
| 56 | +- To see if other users have experienced (and potentially already solved) the same issue |
| 57 | + you are having, check if there is not already a bug report existing for your bug or |
| 58 | + error in the [bug tracker](https:/github.com/pysal/gwlearn/issues?q=label%3Abug). |
| 59 | +- Also make sure to search the internet (including Stack Overflow) to see if users |
| 60 | + outside of the GitHub community have discussed the issue. |
| 61 | +- Collect information about the bug: |
| 62 | +- Stack trace (Traceback) |
| 63 | +- OS, Platform and Version (Windows, Linux, macOS, x86, ARM) |
| 64 | +- Version of the Python and all the dependencies. |
| 65 | +- Possibly your input and the output |
| 66 | +- Can you reliably reproduce the issue? And can you also reproduce it with older |
| 67 | + versions? |
| 68 | + |
| 69 | +<!-- omit in toc --> |
| 70 | +#### How Do I Submit a Good Bug Report? |
| 71 | + |
| 72 | +We use GitHub issues to track bugs and errors. If you run into an issue with the |
| 73 | +project: |
| 74 | + |
| 75 | +- Open an [Issue](https:/github.com/pysal/gwlearn/issues/new). (Since we can't be sure |
| 76 | + at this point whether it is a bug or not, we ask you not to talk about a bug yet and |
| 77 | + not to label the issue.) |
| 78 | +- Explain the behavior you would expect and the actual behavior. |
| 79 | +- Please provide as much context as possible and describe the *reproduction steps* that |
| 80 | + someone else can follow to recreate the issue on their own. This usually includes your |
| 81 | + code. For good bug reports you should isolate the problem and create a reduced test |
| 82 | + case. |
| 83 | +- Provide the information you collected in the previous section. |
| 84 | + |
| 85 | +Once it's filed: |
| 86 | + |
| 87 | +- The project team will label the issue accordingly. |
| 88 | +- A team member will try to reproduce the issue with your provided steps. If there are |
| 89 | + no reproduction steps or no obvious way to reproduce the issue, the team will ask you |
| 90 | + for those steps. Bugs that cannot be reproduced will not be addressed until they are |
| 91 | + reproduced. |
| 92 | +- If the team is able to reproduce the issue, it will be marked, and the issue will be |
| 93 | + left to be implemented by someone. |
| 94 | + |
| 95 | +### Suggesting Enhancements |
| 96 | + |
| 97 | +This section guides you through submitting an enhancement suggestion for gwlearn, |
| 98 | +**including completely new features and minor improvements to existing functionality**. |
| 99 | +Following these guidelines will help maintainers and the community to understand your |
| 100 | +suggestion and find related suggestions. |
| 101 | + |
| 102 | +<!-- omit in toc --> |
| 103 | +#### Before Submitting an Enhancement |
| 104 | + |
| 105 | +- Make sure that you are using the latest version. |
| 106 | +- Read the [documentation](https://pysal.org/gwlearn) carefully and find out if the |
| 107 | + functionality is already covered, maybe by an individual configuration. |
| 108 | +- Perform a [search](https:/github.com/pysal/gwlearn/issues) to see if the enhancement |
| 109 | + has already been suggested. If it has, add a comment to the existing issue instead of |
| 110 | + opening a new one. |
| 111 | +- Find out whether your idea fits with the scope and aims of the project. It's up to you |
| 112 | + to make a strong case to convince the project's developers of the merits of this |
| 113 | + feature. Keep in mind that we want features that will be useful to the majority of our |
| 114 | + users and not just a small subset. If you're just targeting a minority of users, |
| 115 | + consider writing an add-on/plugin library. |
| 116 | + |
| 117 | +<!-- omit in toc --> |
| 118 | +#### How Do I Submit a Good Enhancement Suggestion? |
| 119 | + |
| 120 | +Enhancement suggestions are tracked as |
| 121 | +[GitHub issues](https:/github.com/pysal/gwlearn/issues). |
| 122 | + |
| 123 | +- Use a **clear and descriptive title** for the issue to identify the suggestion. |
| 124 | +- Provide a **step-by-step description of the suggested enhancement** in as many details |
| 125 | + as possible. |
| 126 | +- **Describe the current behavior** and **explain which behavior you expected to see |
| 127 | + instead** and why. At this point you can also tell which alternatives do not work for |
| 128 | + you. |
| 129 | +- **Explain why this enhancement would be useful** to most gwlearn users. You may also |
| 130 | + want to point out the other projects that solved it better and which could serve as |
| 131 | + inspiration. |
| 132 | + |
| 133 | +### Code Contribution |
| 134 | + |
| 135 | +You can create a development environment using [Pixi](https://pixi.sh): |
| 136 | + |
| 137 | +```sh |
| 138 | +pixi install |
| 139 | +``` |
| 140 | + |
| 141 | +Or with conda using the environment files with `latest` in the `ci` folder: |
| 142 | + |
| 143 | +```sh |
| 144 | +conda env create -f ci/py313_latest.yaml -n gwlearn |
| 145 | +``` |
| 146 | + |
| 147 | +To install `gwlearn` to the Conda environment in an editable form, clone the repository, |
| 148 | +navigate to the main directory and install it with pip: |
| 149 | + |
| 150 | +```sh |
| 151 | +pip install -e . |
| 152 | +``` |
| 153 | + |
| 154 | +When submitting a pull request: |
| 155 | + |
| 156 | +- All existing tests should pass. Please make sure that the test suite passes, both |
| 157 | + locally and on GitHub Actions. Status on GHA will be visible on a pull request. GHA |
| 158 | + are automatically enabled on your own fork as well. To trigger a check, make a PR to |
| 159 | + your own fork. |
| 160 | +- Ensure that documentation has built correctly. It will be automatically built after |
| 161 | + merging your commit to main. |
| 162 | +- New functionality ***must*** include tests. Please write reasonable tests for your |
| 163 | + code and make sure that they pass on your pull request. |
| 164 | +- Classes, methods, functions, etc. should have docstrings. The first line of a |
| 165 | + docstring should be a standalone summary. Parameters and return values should be |
| 166 | + documented explicitly. |
| 167 | +- Follow PEP 8 when possible. We use `ruff` for linting and formatting to ensure |
| 168 | + robustness & consistency in code throughout the project and `ty` for type hint |
| 169 | + checking. Ruff is included in the `pre-commit` hook and both style and type hints will |
| 170 | + be checked on every PR. |
| 171 | +- `gwlearn` supports Python versions according to |
| 172 | + [SPEC0](https://scientific-python.org/specs/spec-0000/). When possible, do not |
| 173 | + introduce additional dependencies. If that is necessary, make sure they can be treated |
| 174 | + as optional. |
| 175 | + |
| 176 | +#### Procedure |
| 177 | + |
| 178 | +1. *After* opening an issue and discussing with the development team, create a PR with |
| 179 | + the proposed changes. |
| 180 | + |
| 181 | +<!-- omit in toc --> |
| 182 | +## Attribution |
| 183 | + |
| 184 | +This guide is based on the **contributing-gen**. |
| 185 | +[Make your own](https://github.com/bttger/contributing-gen)! |
0 commit comments