Skip to content

update notebook convention result var#1639

Open
classiqdor wants to merge 5 commits into
mainfrom
update_notebook_convention__result_var
Open

update notebook convention result var#1639
classiqdor wants to merge 5 commits into
mainfrom
update_notebook_convention__result_var

Conversation

@classiqdor

Copy link
Copy Markdown
Contributor
  • Name execution-result variables result / result_ (main)
  • Name execution-result variables result / result_ (community & other)
  • Restore prose wording clobbered by the result-variable rename
  • Drop the intermediate job variable when only used to fetch the result
  • Parse results via result_value(), not result()[0].value

Rename execution-result value variables to result (or result_<suffix> when a
notebook has several); genuine ExecutionJob variables to job / job_<suffix>.
DataFrame results from sample() are named df / df_<suffix> (dfs for a list),
matching the existing pandas idiom rather than result.
… other)

Same convention applied to community and functions notebooks.
The whole-word rename also touched comments/docstrings; revert those back to
natural English (measurement results, plot results, show the result, for each
result) where the word was prose, not the variable.
Where a job = execute(...) is used solely for a single job.result_value() /
job.get_sample_result(), inline it to result = execute(...).result_value() to
match the one-liner used across the library. Genuine ExecutionJob variables
(open_in_ide / id / status / list .result()) are kept as job.
Point-3 cases the earlier pass missed because the variable was res/res_* (now
result*): X = execute(...).result() + X[0].value  ->  X = execute(...).result_value() + X.
Includes cooling's block_encoding_from_results helper (res[0].value -> res).
Left as-is: qaoa_demonstration's execution_result[1].value (genuinely needs the
list) and randomized_benchmarking's async result_async() batch.
@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

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