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

Fix code examples #13178

Merged
merged 2 commits into from
Sep 18, 2024
Merged

Fix code examples #13178

merged 2 commits into from
Sep 18, 2024

Conversation

frankharkins
Copy link
Member

Summary

Minor fixes to code examples in docstrings to make sure they run without error. Mostly adding imports and defining variables. Some syntax errors too.

These were identified as part of Qiskit/documentation#1893.

@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @enavarro51
  • @Cryoris
  • @Qiskit/terra-core
  • @ajavadia
  • @levbishop
  • @nkanazawa1989
  • @t-imamichi

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Thanks for looking at this Frank. Longer term, I think we'll want to consider when it's appropriate to show imports to users - repeating the same imports several times in quick succession over the course of a run of examples probably feels like it could get noisy quickly.

Similarly, things like import numpy as np and from qiskit.circuit import QuantumCircuit probably happen enough that if they're the only imports, or if the only import is the class/function in question (whose documentation should already clearly imply how to import it), maybe it's best not to include the noise?

Anyway, that's for the future - doesn't need thinking about right now, particularly.

qiskit/pulse/schedule.py Outdated Show resolved Hide resolved
qiskit/transpiler/__init__.py Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Sep 18, 2024

Pull Request Test Coverage Report for Build 10922719194

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.5%) to 88.816%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 2 92.73%
Totals Coverage Status
Change from base Build 10919208944: 0.5%
Covered Lines: 73472
Relevant Lines: 82724

💛 - Coveralls

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Copy link
Contributor

@ihincks ihincks left a comment

Choose a reason for hiding this comment

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

Thanks @frankharkins , all of the primitive blocks look correct to me

@wshanks
Copy link
Contributor

wshanks commented Sep 18, 2024

The pulse changes look okay to me, but keep in mind that pulse is being moved out of this repo (#13164).

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Thanks Frank

@jakelishman jakelishman added this pull request to the merge queue Sep 18, 2024
@jakelishman jakelishman added documentation Something is not clear or an error documentation stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog labels Sep 18, 2024
@jakelishman jakelishman added this to the 1.3.0 milestone Sep 18, 2024
Merged via the queue into Qiskit:main with commit cc1f30f Sep 18, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Sep 18, 2024
* Fix code examples

* Incorporate feedback

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>

---------

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
(cherry picked from commit cc1f30f)
@frankharkins frankharkins deleted the FH/fix-code-examples branch September 18, 2024 16:21
github-merge-queue bot pushed a commit that referenced this pull request Sep 18, 2024
* Fix code examples

* Incorporate feedback

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>

---------

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
(cherry picked from commit cc1f30f)

Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog documentation Something is not clear or an error documentation stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants