Skip to content

update notebook convention result value#1623

Open
classiqdor wants to merge 4 commits into
mainfrom
update_notebook_convention__result_value
Open

update notebook convention result value#1623
classiqdor wants to merge 4 commits into
mainfrom
update_notebook_convention__result_value

Conversation

@classiqdor

Copy link
Copy Markdown
Contributor
  • Use result_value() instead of result()[0].value
  • Add notebook-uniformity pre-commit (plural References)
  • Enforce result_value() in notebook-uniformity hook
  • Enforce show(qprog) over qprog.show() in notebook-uniformity hook

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

New auto-fixing hook .internal/pre_commit_tools/notebook_uniformity.py, wired into .pre-commit-config.yaml as 'notebook-uniformity'. First rule: a references heading must be plural ('References'). Auto-fixed the 11 existing notebooks with a singular heading.
Second rule for the notebook-uniformity hook: auto-fix .result()[0].value to .result_value() in code cells (only index [0], which is the safe equivalent). The repo is already clean, so this just guards against regressions.
Third rule: auto-fix the qprog.show() method form to show(qprog) in code cells, scoped to circuit vars (qprog*/quantum_program*/qp) so matplotlib's plt.show() is never touched. Fixed the one offender (hw_aware_synthesis).
@classiqdor classiqdor force-pushed the update_notebook_convention__result_value branch from 32f0556 to c2ba4d1 Compare June 25, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant