This page outlines the recommended procedure for contributing changes to the PyCBC repository. Please familiarise yourself with GitHub ensure your account is configured according to these instructions.
When reporting issues, please include as much detail as possible to reproduce the error, including information about your operating system and the version of each (relevant) component of PyCBC. If possible, please include a brief, self-contained code example that demonstrates the problem.
All contributions to PyCBC code must be made using the GitHub Flow model, which must then be reviewed by one of the project maintainers.
If you wish to contribute new code, or changes to existing code, please follow the following development workflow.
You only need to do this once
- Go to the PyCBC repository home page
- Click on the Fork button (top-right-hand corner)
- Select the namespace that you want to create the fork in, this will usually be your personal namespace
git clone https://github.com/<username>/pycbc.git
If you already have a fork of PyCBC, and are starting work on a new project you can link your clone to the main (gwastro
) repository and pull in changes that have been merged since the time you created your fork, or last updated:
-
Link your fork to the main repository:
cd pycbc git remote add gwastro https://github.com/gwastro/pycbc.git
-
Fetch new changes from the
gwastro
repogit fetch gwastro
All changes should be developed on a feature branch, in order to keep them separate from other work, simplifying review and merge once the work is done.
To create a new feature branch:
git fetch gwastro
git checkout -b my-new-feature gwastro/master
-
Develop the changes you would like to introduce, using
git commit
to finalise a specific change. Ideally commit small units of change often, rather than creating one large commit at the end, this will simplify review and make modifying any changes easier.Commit messages should be clear, identifying which code was changed, and why. Common practice is to use a short summary line (<50 characters), followed by a blank line, then more information in longer lines.
-
Push your changes to the remote copy of your fork on GitHub
git push origin my-new-feature
Note: For the first
push
of any new feature branch, you will likely have to use the-u/--set-upstream
option topush
to create a link between your new branch and theorigin
remote:git push --set-upstream origin my-new-feature
When you feel that your work is finished, you should create a Pull Request to propose that your changes be merged into the main (gwastro
) repository.
After you have pushed your new feature branch to origin
, you should find a new button on the PyCBC repository home page inviting you to create a Pull Request out of your newly pushed branch.
You should click the button, and proceed to fill in the title and description boxes on the PR page.
Once the request has been opened, one of the maintainers will assign someone to review the change.
During this process you might have some suggestions about code layout (mostly automated). Please see here for guidance on that:
https://github.com/gwastro/pycbc/wiki/How-to-satisfy-CodeClimate
More information regarding the usage of GitHub can be found in the GitHub Guides.