|
| 1 | +# Contributing |
| 2 | + |
| 3 | +When it comes to planning in the built environment, we think transparency is critical. The shape and operations of our shared infrastructure and public spaces impacts individuals’ access to employment opportunities, education, social communities, clean air, and safe mobility options. |
| 4 | +We think open source, agent based models are the future for transparent, granular city planning. So we built GeNet which helps to make the process of modifying and validating MATSim transport networks a little less painful. |
| 5 | + |
| 6 | +Thank you for considering contributing to GeNet! We're really excited to hear your opinions on the project and any ideas |
| 7 | +you may have on how it can be better! |
| 8 | + |
| 9 | +Please note we have a code of conduct. Please follow it in all your interactions with the project. |
| 10 | + |
| 11 | +## Ways to Contribute |
| 12 | + |
| 13 | +There are a number of ways you can contribute to the project. The major two are: |
| 14 | +- Submitting a GitHub issue. This could involve: |
| 15 | + - Logging a bug or undesirable behaviour |
| 16 | + - Recording area of possible improvement |
| 17 | + - Requesting a change or addition of a new feature |
| 18 | +- Contributing code. Our work is never done, if you have an idea how you could make GeNet better or if you think you |
| 19 | +could generalise it: |
| 20 | + - You can outline the new feature or desired behaviour in a GitHub issue and send us an email on [[email protected]](mailto:[email protected]) |
| 21 | + to let us know you're willing to work on it. We may invite you for a brief rubber-ducking session to go through |
| 22 | + your idea in more detail. The aim is to mature your idea with one (or more) GeNet developers and to flag |
| 23 | + any possible blocks or implementation issues to be aware of. |
| 24 | + - Please follow advice below on Contributing Code, working in a branch and the Pull Request process. |
| 25 | + - You may continue to, and are encouraged to, keep in touch and reach out to us throughout your development work. |
| 26 | + |
| 27 | +See this helpful site on [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) for more ideas |
| 28 | + on how you could contribute. Get in touch with us via email [[email protected]](mailto:[email protected]). |
| 29 | + |
| 30 | +## Submitting Issues |
| 31 | + |
| 32 | +If you have an idea for an enhancement, a change or addition of new feature or behaviour for GeNet or a record of a bug |
| 33 | +you can communicate this to us in detail through a written account as a GitHub issue on GeNet's [issues page](https://github.com/arup-group/genet/issues). |
| 34 | + |
| 35 | +A good issue will outline the problem in a full written format. It is helpful to include screenshots, especially to |
| 36 | +highlight any physical issues with the network. It is also helpful to include why you think the new feature would be |
| 37 | +useful, what problem is it solving and whether there is a real-world cases study that would benefit from this |
| 38 | +improvement. |
| 39 | + |
| 40 | +In case of bugs, please provide the full error message, the OS and |
| 41 | +information about the environment in which the process had been ran. It is also helpful to include a small |
| 42 | +(if possible) set of data on which the problem can be recreated---at the very least, a thorough description of the |
| 43 | +input data should be included. |
| 44 | + |
| 45 | +See this page on [Creating an issue](https://github.com/arup-group/genet/issues) on GitHub to learn how to submit an |
| 46 | +issue. |
| 47 | + |
| 48 | +## Contributing Code - Pull Request Process |
| 49 | + |
| 50 | +1. All new work is done in a branch taken from master, details can be found here: |
| 51 | +[feature branch workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow) |
| 52 | +2. Ensure your work is covered by unit tests to the required percentage level. This script |
| 53 | +[`bash_scripts/code-coverage.sh`](https://github.com/arup-group/genet/blob/master/bash_scripts/code-coverage.sh) |
| 54 | + will help both in checking that the coverage level is satisfied and investigating places in code that have not been |
| 55 | + covered by the tests (via an output file `reports/coverage/index.html` which can be viewed in a browser). |
| 56 | +3. Ensure the sample notebooks execute without error by running `./bash_scripts/notebooks-smoke-test.sh`. Problems in |
| 57 | +the core GeNet APIs or in the notebooks themselves can both cause notebook failures. |
| 58 | +4. Provide [docstrings](https://www.python.org/dev/peps/pep-0257/) for new methods |
| 59 | +5. Perform linting locally using ```flake8 . --max-line-length 120 --count --show-source --statistics --exclude=scripts,tests``` |
| 60 | +6. Add or update dependencies in `requirements.txt` if applicable |
| 61 | +7. Ensure the CI build pipeline (Actions tab in GitHub) completes successfully for your branch. The pipeline performs |
| 62 | +automated `PEP8` checks and runs unit tests in a fresh environment, as well as installation of all dependencies. |
| 63 | +8. Update/add to or generate a new jupyter notebook in `notebooks` directory which takes the user through your new feature or |
| 64 | +change. You may use example data already in `example_data` directory of this repo, or add more (small amount of) data to |
| 65 | +it to show off your new features. |
| 66 | +9. Add section in the `README.md` which shows usage of your new feature. This can be paraphrased from the jupyter |
| 67 | +notebook in point above. |
| 68 | +10. If the feature is to be used in an automated workflow through the docker image, create n example script in the |
| 69 | +`scripts` directory. Please use existing scripts as templates. |
| 70 | +11. Submit your Pull Request (see [GitHub Docs on Creating a Pull Request](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)), |
| 71 | + describing the feature, linking to any relevant GitHub issues and request review from at |
| 72 | +least two developers. (Please take a look at latest commits to find out which developers you should request review from) |
| 73 | +12. You may merge the Pull Request in once you have the sign-off of two other developers, or if you |
| 74 | +do not have permission to do that, please request one of the reviewers to merge it for you. |
| 75 | + |
| 76 | +## Attribution |
| 77 | + |
| 78 | +The Contribution Guide was adapted from [PurpleBooth's Template](https://gist.github.com/PurpleBooth/b24679402957c63ec426). |
0 commit comments