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

Python code examples #43

Merged
merged 15 commits into from
Jul 5, 2021
Merged

Python code examples #43

merged 15 commits into from
Jul 5, 2021

Conversation

Mandrenkov
Copy link
Collaborator

Context:
Presently, the Using Jet section of the Sphinx documentation does not contain any Python code examples. This PR primarily adds an equivalent Python code snippet to each existing C++ code snippet using the sphinx-tabs extension.

Description of the Change:

  • The project README now has Python installation instructions and a corresponding hello world program.
  • Each C++ code block featured in a Using Jet tutorial is now paired with an equivalent Python code block.
    • Clicking the "C++" or "Python" tab of any code example applies the same change to all the other examples.

code_examples

Benefits:

  • New Python users can quickly learn how to install Jet and follow along with the high-level Jet tutorials.

Possible Drawbacks:

  • The README appears a bit longer which may discourage some developers from reading it thoroughly.

Related GitHub Issues:
None

@Mandrenkov Mandrenkov added the documentation 📚 Improvements or additions to documentation label Jul 2, 2021
@Mandrenkov Mandrenkov requested a review from josh146 July 2, 2021 20:59
@github-actions
Copy link

github-actions bot commented Jul 2, 2021

Test Report (C++) on Ubuntu

    1 files  ±0      1 suites  ±0   0s ⏱️ ±0s
521 tests ±0  521 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
870 runs  ±0  870 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit ddb21f9. ± Comparison against base commit 29805e4.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jul 2, 2021

Test Report (C++) on MacOS

    1 files  ±0      1 suites  ±0   0s ⏱️ ±0s
521 tests ±0  521 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
870 runs  ±0  870 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit ddb21f9. ± Comparison against base commit 29805e4.

♻️ This comment has been updated with latest results.

Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

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

Looks wonderful! I love how the sphinx tabs work.

All my comments are minor so I'm happy to approve. The only one that should be addressed is that the sphinx docs keep referring to 'installation instructions', however every link seems broken. It is currently pointed to /use/installing.html? I also couldn't find installation instructions in the ToC?

Oh, I just realized it should be pointing to the Development Guide? As a 'user' that wants to install Jet but not develop for it, I kept looking for an 'Install' or 'Getting Started' page in the 'Using Jet' section.

README.rst Show resolved Hide resolved
docs/use/tensor_network_files.rst Outdated Show resolved Hide resolved
docs/use/tensor_network_files.rst Outdated Show resolved Hide resolved
docs/use/tensor_networks.rst Show resolved Hide resolved
docs/use/tensor_networks.rst Show resolved Hide resolved
docs/use/tensors.rst Outdated Show resolved Hide resolved
docs/use/tensors.rst Show resolved Hide resolved
docs/use/tensors.rst Outdated Show resolved Hide resolved
docs/use/tensors.rst Outdated Show resolved Hide resolved
docs/xanadu_theme/static/xanadu.css_t Show resolved Hide resolved
@Mandrenkov
Copy link
Collaborator Author

Looks wonderful! I love how the sphinx tabs work.

Awesome!

The only one that should be addressed is that the sphinx docs keep referring to 'installation instructions', however every link seems broken.

Thanks for catching that - it's fixed now.

I also couldn't find installation instructions in the ToC?

Ah, you can find those instructions under "Development Guide" (similar to SF).

Oh, I just realized it should be pointing to the Development Guide? As a 'user' that wants to install Jet but not develop for it, I kept looking for an 'Install' or 'Getting Started' page in the 'Using Jet' section.

I agree with you although neither PL or SF have an explicit section in the ToC for installation instructions. Perhaps this is something we should change across all of the Xanadu OSS projects?

@josh146
Copy link
Member

josh146 commented Jul 5, 2021

I agree with you although neither PL or SF have an explicit section in the ToC for installation instructions. Perhaps this is something we should change across all of the Xanadu OSS projects?

They used to --- we since moved this to the main navbar, since we wanted to make it as accessible as possible:

image

image

The Walrus is the one exception - here, it remained in the Sphinx TOC:

image

This is (partly) because including it in the main navbar involved working out how to get Sphinx to include static pages in the build (or something like that). Doable, we just never got around to it!

@Mandrenkov
Copy link
Collaborator Author

Oh, true - I forgot about the navbar! We should definitely add an "Install" link there once the main website is live since the static HTML page approach used by SF feels like a bit of a maintenance burden.

@Mandrenkov Mandrenkov merged commit e7fa508 into main Jul 5, 2021
@Mandrenkov Mandrenkov deleted the bilingual-examples branch July 5, 2021 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📚 Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants