We'd love to accept your patches and contributions to this project. We do have some guidelines to follow, covered in this document, but don't worry about (or expect to) get everything right the first time! Create a pull request and we'll nudge you in the right direction.
Contributions to this project must be accompanied by a NASA Contributor License Agreement.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. GitHub Help has information on using pull requests.
The preferred manner for submitting pull requests is for users to fork the Pysa repo and then use a branch from this fork to create a pull request to the main PySA repo.
The basic process for setting up a fork is 1. Fork the PySA repo (Fork
button in upper right corner of repo page).
Forking creates a new github repo at the location
https://github.com/USERNAME/pysa
where USERNAME
is your github
id. Use the directions on the development page to
download a copy to your local machine. You need only do this once.
- Checkout main and create a new branch:
where
git checkout main -b new_branch_name
new_branch_name
is the name of your new branch. - Do your work and commit your changes to this branch.
- If you have drifted out of sync from the main PySA repo
you may need to merge in changes. To do this, first update your local
main and then merge the local main into your branch:
You may need to fix merge conflicts for both of these merge commands.
# Update your local main. git fetch upstream git checkout main git merge upstream/main # Merge local main into your branch. git checkout new_branch_name git merge main
- Finally, push your change to your clone
git push origin new_branch_name
- Now when you navigate to the PySA page on github, https://github.com/nasa/pysa you should see the option to create a new pull request from your clone repository. Alternatively you can create the pull request by navigating to the "Pull requests" tab in the page, and selecting the appropriate branches.
- The reviewer will comment on your code and may ask for changes, you can perform these locally, and then push the new commit following the same process as above.
When a pull request is created or updated, various automatic checks will run to ensure that the change won't break PySA and meets our coding standards.
Please be aware of the following code standards that will be applied to any new changes.
- Tests. Existing tests must continue to pass (or be updated) when new changes are introduced. We use pytest to run our Python tests.
- Formatting. Code should meet common style standards for python and C++, and be free of error-prone constructs. We use YAPF and clang-format to format files.