Skip to content

Update docstrings for renamed scheduling passes#7884

Merged
mergify[bot] merged 8 commits into
Qiskit:mainfrom
mtreinish:update-docs-new-schedulers
Apr 19, 2022
Merged

Update docstrings for renamed scheduling passes#7884
mergify[bot] merged 8 commits into
Qiskit:mainfrom
mtreinish:update-docs-new-schedulers

Conversation

@mtreinish
Copy link
Copy Markdown
Member

Summary

In #7835 we renamed the passes used in the new scheduler pass workflow
to differentiate them from the existing legacy scheduling pass workflow
(which we restored pending a future deprecation in that PR). However,
while we updated the docstring for the legacy path to update them to
point to the new passes, we neglected to update the docstrings for the
renamed classes to reflect the new names. The examples in the docstrings
still worked because of the old passes, but it wasn't showing an example
of how to use the new workflow anymore. This commit corrects this
oversight so that they actually explain how to use them.

Details and comments

In Qiskit#7835 we renamed the passes used in the new scheduler pass workflow
to differentiate them from the existing legacy scheduling pass workflow
(which we restored pending a future deprecation in that PR). However,
while we updated the docstring for the legacy path to update them to
point to the new passes, we neglected to update the docstrings for the
renamed classes to reflect the new names. The examples in the docstrings
still worked because of the old passes, but it wasn't showing an example
of how to use the new workflow anymore. This commit corrects this
oversight so that they actually explain how to use them.
@mtreinish mtreinish added 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. documentation labels Apr 4, 2022
@mtreinish mtreinish added this to the 0.20.1 milestone Apr 4, 2022
@mtreinish mtreinish requested a review from a team as a code owner April 4, 2022 16:25
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.

It'll be good to get the documentation back in line with the actual behaviour.

Comment on lines -23 to +24
See :class:`~qiskit.transpiler.passes.scheduling.base_scheduler.BaseScheduler` for the
detailed behavior of the control flow operation, i.e. ``c_if``.
See :class:`~qiskit.transpiler.passes.scheduling.scheduling.base_scheduler.BaseScheduler` for
the detailed behavior of the control flow operation, i.e. ``c_if``.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this (or any similar) cross-ref will resolve; BaseScheduler isn't included in any autosummary directive.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's not, I noticed that too after I pushed it. This was existing before I just mechanically updated the paths for things. I'm not sure how we want to handle this, since to include it in the doc tree we'd probably need to re-export the class to qiskit/transpiler/passes/__init__.py but I assume @nkanazawa1989 didn't do that intentionally.

@nkanazawa1989 do you have any preference on how you want to include the BaseScheduler class in the docs?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Umm... I wrote detailed document about the policy of classical IO handling there, and I don't want to copy the document for every child scheduler pass. Because BaseScheduler is an abstract class, I think we don't need to expose this to module level import, but I want to provide this docs with users. Perhaps we can move document to https://qiskit.org/documentation/apidoc/transpiler.html and replace the link?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I added a scheduling section to the top level transpiler docs and included these details there in: 3ae60d2

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 4, 2022

Pull Request Test Coverage Report for Build 2186571356

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.005%) to 83.943%

Files with Coverage Reduction New Missed Lines %
qiskit/pulse/library/waveform.py 3 89.36%
Totals Coverage Status
Change from base Build 2186502806: -0.005%
Covered Lines: 54213
Relevant Lines: 64583

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

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

Almost looking good to me. Just a nitpick. Thanks for additional docs cleanup.

Comment thread qiskit/transpiler/__init__.py Outdated
Comment thread qiskit/transpiler/__init__.py Outdated
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
nkanazawa1989
nkanazawa1989 previously approved these changes Apr 12, 2022
@mtreinish mtreinish requested a review from jakelishman April 12, 2022 13:22
kevinhartman
kevinhartman previously approved these changes Apr 18, 2022
Copy link
Copy Markdown
Contributor

@kevinhartman kevinhartman left a comment

Choose a reason for hiding this comment

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

LGTM.

Comment thread qiskit/transpiler/__init__.py Outdated
Comment thread qiskit/transpiler/__init__.py Outdated
Comment thread qiskit/transpiler/__init__.py Outdated
Comment thread qiskit/transpiler/__init__.py Outdated
@mtreinish mtreinish dismissed stale reviews from kevinhartman and nkanazawa1989 via 402bdd7 April 18, 2022 21:54
Co-authored-by: Kevin Hartman <kevin@hart.mn>
@mtreinish mtreinish requested a review from kevinhartman April 18, 2022 21:54
@mergify mergify Bot merged commit a4edc11 into Qiskit:main Apr 19, 2022
mergify Bot added a commit that referenced this pull request Apr 19, 2022
* Update docstrings for renamed scheduling passes

In #7835 we renamed the passes used in the new scheduler pass workflow
to differentiate them from the existing legacy scheduling pass workflow
(which we restored pending a future deprecation in that PR). However,
while we updated the docstring for the legacy path to update them to
point to the new passes, we neglected to update the docstrings for the
renamed classes to reflect the new names. The examples in the docstrings
still worked because of the old passes, but it wasn't showing an example
of how to use the new workflow anymore. This commit corrects this
oversight so that they actually explain how to use them.

* Add scheduling section to top level transpiler doc

* Update reference

* Fix lint

* Fix typos

Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>

* Apply suggestions from code review

Co-authored-by: Kevin Hartman <kevin@hart.mn>

Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
Co-authored-by: Kevin Hartman <kevin@hart.mn>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit a4edc11)
mergify Bot added a commit that referenced this pull request Apr 19, 2022
* Update docstrings for renamed scheduling passes

In #7835 we renamed the passes used in the new scheduler pass workflow
to differentiate them from the existing legacy scheduling pass workflow
(which we restored pending a future deprecation in that PR). However,
while we updated the docstring for the legacy path to update them to
point to the new passes, we neglected to update the docstrings for the
renamed classes to reflect the new names. The examples in the docstrings
still worked because of the old passes, but it wasn't showing an example
of how to use the new workflow anymore. This commit corrects this
oversight so that they actually explain how to use them.

* Add scheduling section to top level transpiler doc

* Update reference

* Fix lint

* Fix typos

Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>

* Apply suggestions from code review

Co-authored-by: Kevin Hartman <kevin@hart.mn>

Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
Co-authored-by: Kevin Hartman <kevin@hart.mn>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit a4edc11)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
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. 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.

5 participants