Skip to content

Fix code examples#13178

Merged
jakelishman merged 2 commits intoQiskit:mainfrom
frankharkins:FH/fix-code-examples
Sep 18, 2024
Merged

Fix code examples#13178
jakelishman merged 2 commits intoQiskit:mainfrom
frankharkins:FH/fix-code-examples

Conversation

@frankharkins
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread qiskit/pulse/schedule.py
Comment thread qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py Outdated
Comment thread qiskit/transpiler/__init__.py Outdated
@coveralls
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 Make Mergify open a backport PR to the most recent stable branch on merge. Changelog: None Do not include in the GitHub Release 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
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 the GitHub Release changelog. documentation Something is not clear or an error documentation stable backport potential Make Mergify open a backport PR to the most recent stable branch on merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants