Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added api docs gen (copy from TFQ). #3089

Merged
merged 11 commits into from
Jun 12, 2020

Conversation

MichaelBroughton
Copy link
Collaborator

First pass on docs build for API (Copies from TFQ). Goes along with #3085.
@yashk2810
@lamberta
I included the built copies of these docs (took all of 10s to build WOW!) for ease of testing, but we should probably remove them before merging.

mpharrigan and others added 5 commits June 9, 2020 15:40
 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref quantumlib#2905
@MichaelBroughton MichaelBroughton requested a review from dabacon June 11, 2020 22:32
@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Jun 11, 2020
Copy link
Contributor

@lamberta lamberta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change merge into branch to docs_site ?

docs/build_api_docs.py Outdated Show resolved Hide resolved
site_path=FLAGS.site_path,
callbacks=[public_api.local_definitions_filter],
private_map={
"cirq.google.engine.client.quantum.QuantumEngineServiceClient" : ["enums"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this argument? Can we comment what this argument does?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callbacks=[public_api.local_definitions_filter],
private_map={
"cirq.google.engine.client.quantum.QuantumEngineServiceClient" : ["enums"],
"cirq.google.engine.client.quantum_v1alpha1.QuantumEngineServiceClient":["enums"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line may be too long. Can you run check/format in order to fix the tests?

Copy link
Collaborator

@dabacon dabacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive by comment :)

# ==============================================================================
"""Tool to generate external api_docs for Cirq (Shameless copy from TFQ)."""

from __future__ import absolute_import
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these future imports necessay since we don't support python < 3.6?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@MichaelBroughton MichaelBroughton changed the base branch from master to docs_site June 12, 2020 19:26
@MichaelBroughton MichaelBroughton merged commit f3c556d into quantumlib:docs_site Jun 12, 2020
@MichaelBroughton MichaelBroughton deleted the api_builds branch June 12, 2020 19:37
@lamberta lamberta mentioned this pull request Jun 12, 2020
MichaelBroughton added a commit that referenced this pull request Jun 12, 2020
* [SVG] Noise hack and font fix (#3076)


 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref #2905

* Support multi-qubit measurement in plot_state_histogram (#3054)

* Add generated code for batch.proto (#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (#3084)

* Fix Quirk import extra gates bug

* Move image files to docs/images/

* Move unneeded site assets

* Move Sphinx templates, Makefile, conf, and init

* Added api docs gen (copy from TFQ). (#3089)

* [SVG] Noise hack and font fix (#3076)


 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref #2905

* Support multi-qubit measurement in plot_state_histogram (#3054)

* Add generated code for batch.proto (#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (#3084)

* Added api docs gen (copy from TFQ).

* updated site_path prefix.

* removed pre-built.

* rename.

* move to dev_tools.

* removed __future__ and formatting.

* yet more formatting.

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>

* Move doc tools to /dev_tools/docs/

* Move examples index into tutorials/

* Move basics tutorial into tutorials/

* Encode URL bracket so not mistaken for template.

* Update references to moves docs and image files.

* Update references to docs_coverage_test.py

* Format py with check/format-incremental --apply

* Move Sphinx RST files

* Add _index.yaml for site

* Add initial _book.yaml for leftnav

* Manually format docs/_sphinx/conf.py for CI

* Update references to moved api.rst file

* Move docs/_sphinx to dev_tools/docs/sphinx

* Update README.rst path for snippets_test.py

* Move run_doctest to dev_tools/docs/

* Move build-docs.sh to dev_tools/docs/sphinx/

* Update references to build-docs.sh

* Remove build_docs CI test

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>
Co-authored-by: Matteo Pompili <[email protected]>
Co-authored-by: MichaelBroughton <[email protected]>
@MichaelBroughton MichaelBroughton restored the api_builds branch June 12, 2020 20:22
balopat pushed a commit to balopat/Cirq that referenced this pull request Aug 18, 2020
* [SVG] Noise hack and font fix (quantumlib#3076)

 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref quantumlib#2905

* Support multi-qubit measurement in plot_state_histogram (quantumlib#3054)

* Add generated code for batch.proto (quantumlib#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (quantumlib#3084)

* Added api docs gen (copy from TFQ).

* updated site_path prefix.

* removed pre-built.

* rename.

* move to dev_tools.

* removed __future__ and formatting.

* yet more formatting.

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>
balopat pushed a commit to balopat/Cirq that referenced this pull request Aug 18, 2020
* [SVG] Noise hack and font fix (quantumlib#3076)

 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref quantumlib#2905

* Support multi-qubit measurement in plot_state_histogram (quantumlib#3054)

* Add generated code for batch.proto (quantumlib#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (quantumlib#3084)

* Fix Quirk import extra gates bug

* Move image files to docs/images/

* Move unneeded site assets

* Move Sphinx templates, Makefile, conf, and init

* Added api docs gen (copy from TFQ). (quantumlib#3089)

* [SVG] Noise hack and font fix (quantumlib#3076)

 - Specify the font. This should not be a change for viewing in Jupyter notebook but fixes opening the svg data in e.g. inkscape where the default font is different and the boxes aren't the right size
 - Don't display virtual tags (for noise) xref quantumlib#2905

* Support multi-qubit measurement in plot_state_histogram (quantumlib#3054)

* Add generated code for batch.proto (quantumlib#3086)

Review: @dstrain115

* Fix flakes in random_circuit_test (quantumlib#3084)

* Added api docs gen (copy from TFQ).

* updated site_path prefix.

* removed pre-built.

* rename.

* move to dev_tools.

* removed __future__ and formatting.

* yet more formatting.

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>

* Move doc tools to /dev_tools/docs/

* Move examples index into tutorials/

* Move basics tutorial into tutorials/

* Encode URL bracket so not mistaken for template.

* Update references to moves docs and image files.

* Update references to docs_coverage_test.py

* Format py with check/format-incremental --apply

* Move Sphinx RST files

* Add _index.yaml for site

* Add initial _book.yaml for leftnav

* Manually format docs/_sphinx/conf.py for CI

* Update references to moved api.rst file

* Move docs/_sphinx to dev_tools/docs/sphinx

* Update README.rst path for snippets_test.py

* Move run_doctest to dev_tools/docs/

* Move build-docs.sh to dev_tools/docs/sphinx/

* Update references to build-docs.sh

* Remove build_docs CI test

Co-authored-by: Matthew Harrigan <[email protected]>
Co-authored-by: Animesh Sinha <[email protected]>
Co-authored-by: Matthew Neeley <[email protected]>
Co-authored-by: Dave Bacon <[email protected]>
Co-authored-by: Matteo Pompili <[email protected]>
Co-authored-by: MichaelBroughton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants