First off, thank you for considering contributing to our project! It is a community-driven project, so it's people like you that make it useful and successful.
We love contributions from community members, just like you! There are many ways to contribute:
- Submitting bug reports and feature requests
- Writing tutorials or examples
- Improvements to the documentation
- Writing code which can be incorporated into project for everyone to use
If you get stuck at any point you can create an issue on GitHub or contact us at one of the other channels mentioned below.
For more information on contributing to open source projects, GitHub's own guide is a great starting point if you are new to version control. Also, checkout the Zen of Scientific Software Maintenance for some guiding principles on how to create high quality scientific software contributions.
The goal is to maintain a diverse community that's pleasant for everyone. Please be considerate and respectful of others. Everyone must abide by our Code of Conduct and we encourage all to read it carefully.
- Tackle any issues you wish! We have a special label for issues that beginners might want to try. Have a look at our "good first issues" list.
- Contribute code you already have. It doesn’t need to be perfect! We will help you clean things up, test it, etc.
- Make a tutorial or example of how to do something.
- Provide feedback about how we can improve the project or about your particular use case.
Discussion often happens in the issue tracker and in pull requests.
When creating a new issue, please be as specific as possible. This helps us reproduce the bug and track down its cause. Try to include the following:
- Version of the code you were using
- Operating system
- Python installation (Anaconda, system, ETS)
- Full error messages that you got
- Example code that reproduces the problem
Remember: the more information we have, the easier it will be for us to solve your problem.
Working on your first Pull Request? You can learn how from this free video series:
- How to Contribute to an Open Source Project on GitHub
- Aaron Meurer's tutorial on the git workflow
- How to Contribute to Open Source.
General guidelines for Pull Requests:
- Each pull request should consist of a small and logical collection of changes. Larger changes should be broken down into smaller components and integrated separately. This allows us more chance for discussion and less code to review at each time. Please submit bug fixes in separate pull requests.
- Describe what your PR changes and why this is a good thing. Be as specific as you can. The PR description is how we keep track of the changes made to the project over time.
- Do not commit changes to files that are irrelevant to your feature or bugfix (eg: .gitignore, IDE project files, etc).
- Write descriptive commit messages. Chris Beams has written a guide on how to write good commit messages.
- Be willing to accept criticism and work on improving your code; we don't want to break other users' code, so care must be taken not to introduce bugs.
- Be aware that the pull request review process is not immediate, and is generally proportional to the size of the pull request.
- If this is your first contribution, be sure to add yourself to the list of contributors. We want to make sure we acknowledge the hard work you've generously contributed here.
We highly recommend using
Anaconda
and the conda package manager.
It will make your life a lot easier!
Once you have forked and clone the repository to your local machine, create an isolated environment for you to work:
cd sphinx_gmt
conda env create
This will install all you need from conda-forge into a sphinx_gmt
environment.
Activate it by running:
source activate sphinx_gmt
The Makefile provides rules for installing, running linters, etc.
If you don't want to use make, see the Makefile and copy the
commands you want to run.
Install the source as a development version (it will only be available inside the environment and changes to the source will take effect without reinstalling):
make install
We use Black to format the code so we don't have to think about it. You don't have to worry about formatting the code yourself. Before committing, run the following to automatically format your code:
make format
Don't worry if you forget to do it. Our continuous integration systems will warn us and you can make a new commit with the formatted code.
To check your code for style and common errors (runs black and pylint):
make check
Finally, to remove all build files from the repository:
make clean
There is also a Makefile for building the documentation in the doc folder:
cd doc
make html
You can preview the doc pages in your browser by running:
make serve
This will serve the docs at http://127.0.0.1:8009.
Once you've submitted a Pull Request (PR), at this point you're waiting on us. You should expect to hear at least a comment within a couple of days. We may suggest some changes or improvements or alternatives.
Some things that will increase the chance that your pull request is accepted quickly:
- Write a good and detailed description of what the PR does.
- Write tests for the code you wrote/modified.
- Readable code is better than clever code (even with comments).
- Write documentation for your code (docstrings) and leave comments explaining the reason behind non-obvious things.
- Follow the PEP8 style guide for code and the numpy guide for documentation.
Pull requests will automatically have tests run by TravisCI.
This includes running both the unit tests as well as black and pylint.
Github will show the status of these checks on the pull request.
Try to get them all passing (green).
If you have any trouble, leave a comment asking for help.
This guide was adapted from the MetPy Contributing Guide.