@@ -7,21 +7,23 @@ working with you. Here are some guidelines to get you started.
77
88### Summary
99
10- * Read and sign the [ Contributor License Agreement (CLA)] (
11- https://cla.developers.google.com/ ).
12- * Read the [ code of conduct] ( CODE_OF_CONDUCT.md ) .
13- * Follow the [ contribution process] ( #development-process ) .
10+ * Read and sign the [ Contributor License Agreement]
11+ * Read the [ code of conduct] .
12+ * Follow the [ development process] .
13+
14+ [ Contributor License Agreement ] : https://cla.developers.google.com/
15+ [ code of conduct ] : ./CODE_OF_CONDUCT.md
16+ [ development process ] : #development-process
1417
1518### Sign our Contributor License Agreement
1619
1720Contributions to this project must be accompanied by a [ Contributor License
18- Agreement] ( https://cla.developers.google.com/about ) (CLA). You (or your
19- employer) retain the copyright to your contribution; this simply gives us
20- permission to use and redistribute your contributions as part of the project.
21- If you or your current employer have already signed the Google CLA (even if it
22- was for a different project), you probably don't need to do it again. Visit
23- < https://cla.developers.google.com/ > to see your current agreements or to sign
24- a new one.
21+ Agreement] (CLA). You (or your employer) retain the copyright to your
22+ contribution; this simply gives us permission to use and redistribute your
23+ contributions as part of the project. If you or your current employer have
24+ already signed the Google CLA (even if it was for a different project), you
25+ probably don't need to do it again. Visit < https://cla.developers.google.com/ >
26+ to see your current agreements or to sign a new one.
2527
2628Only original work from you and other people who have signed the CLA can be
2729incorporated into the project. By signing the Contributor License Agreement, you
@@ -32,39 +34,37 @@ agree that your contributions are an original work of authorship.
3234In the interest of fostering an open and welcoming environment, contributors and
3335maintainers pledge to make participation in our project and our community a
3436harassment-free experience for everyone. Our community aspires to treat everyone
35- equally, and to value all contributions. Please review our [ code of conduct] (
36- CODE_OF_CONDUCT.md) for more information.
37+ equally, and to value all contributions. Please review our [ code of conduct] for
38+ more information.
3739
3840## Code base conventions
3941
4042TensorFlow Quantum (TFQ) is a Python framework for quantum machine learning
41- (QML) implemented as an add-on to [ TensorFlow] ( https://tensorflow.org ) . User
42- documentation for TFQ is available on the [ TensorFlow Quantum documentation
43- site] ( https://tensorflow.org/quantum ) . The TFQ project generally follows
44- TensorFlow development practices, and the [ TensorFlow contributors' guide] (
45- https://www.tensorflow.org/community/contribute ) is essential reading if you
46- want to get involved with TFQ.
43+ (QML) implemented as an add-on to [ TensorFlow] . User documentation for TFQ is
44+ available on the [ TensorFlow Quantum documentation site] . The TFQ project
45+ generally follows TensorFlow development practices, and the [ TensorFlow
46+ contribution guide] is essential reading if you want to get involved with TFQ.
47+
48+ [ TensorFlow ] : https://tensorflow.org
49+ [ TensorFlow Quantum documentation site ] : https://tensorflow.org/quantum
50+ [ TensorFlow contribution guide ] : https://www.tensorflow.org/community/contribute
4751
4852### Getting oriented
4953
5054Here is a summary of the main subdirectories in the TFQ source tree:
5155
52- * ** benchmarks/** : Code for performance benchmarking
53- * ** docs/** : Documentation source files
54- * ** release/** : Scripts and configurations for building and releasing TFQ
55- packages
56- * ** scripts/** : Utility scripts for running tests and doing various
57- development tasks
58- * ** tensorflow_quantum/** : The core source code for TensorFlow Quantum
59- * ** third_party/** : External dependencies and third-party integrations
60- * ** .github/** : GitHub-specific configurations, such as continuous
61- integration workflows
56+ * ` benchmarks/ ` : Code for performance benchmarking
57+ * ` docs/ ` : Documentation source files
58+ * ` release/ ` : Scripts and configurations for building TFQ releases
59+ * ` scripts/ ` : Utility for running tests and doing other tasks
60+ * ` tensorflow_quantum/ ` : The core source code for TensorFlow Quantum
61+ * ` third_party/ ` : External dependencies and third-party integrations
62+ * * ` github/ ` : GitHub-specific configurations and workflows
6263
6364### Coding style
6465
65- This project follows the [ style guidelines for TensorFlow] (
66- https://www.tensorflow.org/community/contribute/code_style ), which in turn
67- follows these Google style guides:
66+ This project follows the [ TensorFlow style] , which in turn follows these Google
67+ style guides:
6868
6969* [ C++ Style Guide] ( https://google.github.io/styleguide/cppguide.html )
7070* [ Python Style Guide] ( https://google.github.io/styleguide/pyguide.html )
@@ -75,62 +75,61 @@ Software tool configurations can be found in the following files at the top
7575level of the source tree:
7676
7777* ` .editorconfig ` : basic code editor configuration
78- * ` .pylintrc ` : configuration for linting Python files using
79- [ pylint] ( https://www.pylint.org/ )
80- * ` .style.yapf ` : configuration for formatting Python files using [ YAPF] (
81- https://github.com/google/yapf )
82- * ` .yamllint.yaml ` : configuration for linting YAML files using [ yamllint] (
83- https://github.com/adrienverge/yamllint )
78+ * ` .pylintrc ` : configuration for linting Python files using [ Pylint]
79+ * ` .style.yapf ` : configuration for formatting Python files using [ YAPF]
80+ * ` .yamllint.yaml ` : configuration for linting YAML files using [ yamllint]
8481
8582All new source code files longer than 2 lines must begin with a header comment
8683with the copyright and license.
8784
85+ [ Pylint ] : https://www.pylint.org/
86+ [ YAPF ] : https://github.com/google/yapf
87+ [ yamllint ] : https://github.com/adrienverge/yamllint
88+ [ TensorFlow style ] : ttps://www.tensorflow.org/community/contribute/code_style
89+
8890### Git conventions
8991
90- Git commits should be granular. Small, focused commits have many benefits:
91- changes are easier to understand and evaluate (leading to faster and more
92- thorough PR reviews), they allow more effective use of tools like ` git bisect `
93- for debugging, and they make managing changes easier with tools like `git
94- cherry-pick` and ` git rebase`.
92+ Git commits should be small and focused. Granular commits make changes easier to
93+ understand and evaluate (leading to faster and more thorough PR reviews), allow
94+ more effective use of tools like ` git bisect ` for debugging, and allow easier
95+ management of changes with tools like ` git cherry-pick ` and ` git rebase ` .
9596
9697Each commit should:
9798
9899* Represent a single, self-contained change, such as a specific bug fix or the
99100 addition of a specific feature.
100101
101- * Not combine unrelated changes. Reverting a commit should not affect unrelated
102- parts of the overall code.
102+ * Not combine unrelated changes. Reverting a commit should not affect
103+ unrelated parts of the overall code.
103104
104105* Have an easily understood, concise title written in the imperative: "Fix bug
105- ABC," and not "Fixed bug ABC" or "Fixes bug ABC." This convention fits well
106- with messages generated by commands like ` git merge ` and ` git revert ` .
106+ ABC," and not "Fixed bug ABC" or "Fixes bug ABC."
107107
108108* Include a description, unless the change is exceptionally small or obvious.
109109
110110## Development process
111111
112- TensorFlow Quantum development takes place on GitHub using a GitHub-centric
113- workflow.
112+ TFQ development takes place on GitHub using a GitHub-centric workflow.
114113
115- ### Check past issues
114+ ### Past issues
116115
117- Before you begin work, check the [ GitHub Issue Tracker] (
118- https://github.com/tensorflow/quantum/issues?q=sort%3Aupdated-desc+is%3Aissue )
119- (including closed issues) if your idea or bug has been discussed before.
116+ First search the [ issue tracker] ( https://github.com/tensorflow/quantum/issues )
117+ to check if your idea or bug has been discussed before.
120118
121- Before beginning on any substantial changes, we recommend opening a new issue
122- on GitHub (if one doesn't already exist for the topic) and discussing your
123- proposed changes. This will let us give you advice on the proposed changes.
119+ Before beginning on any substantial changes, we recommend opening a new issue on
120+ GitHub (if one doesn't already exist for the topic) and discussing your proposed
121+ changes. This will let us give you advice on the proposed changes.
124122
125- ### Repository forks
123+ ### Repository forks and branches
126124
127- The preferred approach to working on TFQ is to [ fork] (
128- https://docs.github.com/articles/fork-a-repo ) the repository to your GitHub
129- account, clone that fork to your local computing environment, and create a new
130- [ git branch] ( https://docs.github.com/articles/about-branches ) in the fork to do
131- your work.
125+ The preferred approach to working on TensorFlow Quantum is to first create a
126+ [ fork] ( https://docs.github.com/articles/fork-a-repo ) of the repository in your
127+ GitHub account, then clone that fork to your local computing environment. Keep
128+ your fork regularly synchronized with the upstream TFQ repository. Create a
129+ separate [ git branch] ( https://docs.github.com/articles/about-branches ) for your
130+ work on individual issues or topics.
132131
133- ### Environment setup
132+ ### Set up your environment
134133
135134Follow the instructions in [ docs/install.md] ( docs/install.md ) for setting up a
136135development environment. After doing that, you should end up with:
@@ -157,8 +156,7 @@ scripts/lint_all.sh
157156scripts/format_check.sh
158157```
159158
160- If the format check reports formatting issues, you can correct them
161- automatically using
159+ If the format check reports problems, you can correct them automatically using
162160
163161``` shell
164162scripts/format_all.sh
@@ -183,24 +181,23 @@ corresponding tests. Bug fixes also generally require new unit tests, because
183181the presence of bugs usually indicates insufficient test coverage. Existing
184182tests must continue to pass (or be updated) when changes are introduced.
185183
186- We use TensorFlow's testing suite for our testing. Make sure that any code that
187- you add follows the [ structure outlined in the TensorFlow documentation] (
188- https://www.tensorflow.org/api_docs/python/tf/test ). To run the TFQ test suite,
189- use the following command:
184+ We use TensorFlow's testing suite for our testing. Tests must follow the
185+ [ TensorFlow test guidelines] ( https://www.tensorflow.org/api_docs/python/tf/test )
186+ in order to work correctly. To run the TFQ test suite, run this command:
190187
191188``` shell
192189scripts/test_all.sh
193190```
194191
195192### Contributing code
196193
197- All submissions require review. We use GitHub's tools for [ pull requests ] (
198- https://docs.github.com/articles/about-pull-requests ) for this purpose .
194+ All submissions require review. We use GitHub's tools for code reviews on
195+ [ pull requests ] ( https://docs.github.com/articles/about-pull-requests ) .
199196
200197#### Final checks
201198
202- Before opening a pull request and requesting a code review, you should make sure
203- that the following tests are passing locally:
199+ Before opening a pull request (PR) and requesting a code review, you should make
200+ sure that the following tests are passing locally:
204201
205202``` shell
206203scripts/lint_all.sh
@@ -210,22 +207,20 @@ scripts/test_all.sh
210207
211208#### Draft pull requests
212209
213- When getting ready to submit your work, first create a [ _ draft_ pull request] (
214- https://help.github.com/articles/creating-a-pull-request-from-a-fork ) from your
215- branch on GitHub to the main project repository. This will trigger continuous
216- integration (CI) checks and other automation on GitHub. The results will appear
217- on the PR page on GitHub. Monitor the CI checks on your PR; if any tests fail,
218- iterate on the develop-test-commit-push process until the problems are
219- resolved.
210+ When getting ready to submit your work, first create a _ draft_ pull request from
211+ your branch on GitHub to the main project repository. (Consult GitHub's
212+ [ docs] ( https://help.github.com/articles/creating-a-pull-request-from-a-fork ) for
213+ help on creating pull requests.) The pull request will trigger continuous
214+ integration (CI) checks and other automation on GitHub. Monitor the checks; if
215+ any tests fail, continue development and testing to resolve the problems.
220216
221217#### Code review
222218
223219Once all the CI checks pass and you are ready to submit the PR for
224- consideration, [ mark the PR as ready for review] (
225- https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request ).
226-
227- A reviewer from the TFQ team will comment on your code and may ask for changes.
228- You can perform the necessary changes locally, commit them to your branch as
229- usual, and then push changes to your fork on GitHub following the same process
230- as above. When you do that, GitHub will update the code in the pull request
231- automatically.
220+ consideration, [ mark the PR as ready for review] . A reviewer from the TFQ team
221+ will comment on your code and may ask for changes. You can perform the necessary
222+ changes locally, commit them to your branch as usual, and then push changes to
223+ your fork on GitHub following the same process as above. When you do that,
224+ GitHub will update the code in the pull request automatically.
225+
226+ [ mark the PR as ready for review ] : https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
0 commit comments