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

Remove validation methods from primitive base classes (backport #11052) #11532

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 9, 2024

This is an automatic backport of pull request #11052 done by Mergify.
Cherry-pick of 05d958b has failed:

On branch mergify/bp/stable/0.46/pr-11052
Your branch is up to date with 'origin/stable/0.46'.

You are currently cherry-picking commit 05d958bbe.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   qiskit/primitives/base/base_estimator.py
	modified:   qiskit/primitives/base/base_primitive.py
	new file:   qiskit/primitives/base/validation.py
	modified:   test/python/primitives/test_estimator.py
	modified:   test/python/primitives/test_primitive.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   qiskit/primitives/base/base_sampler.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

@mergify mergify bot requested review from ikkoham, t-imamichi and a team as code owners January 9, 2024 21:46
@mergify mergify bot added the conflicts used by mergify when there are conflicts in a port label Jan 9, 2024
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core
  • @ajavadia
  • @ikkoham
  • @levbishop
  • @t-imamichi

@github-actions github-actions bot added Changelog: Deprecation Include in "Deprecated" section of changelog mod: primitives Related to the Primitives module labels Jan 9, 2024
@jakelishman jakelishman added this to the 0.46.0 milestone Jan 10, 2024
* Remove validation methods from primitive base classes

This deprecates the argument validation methods from primitive base classes and moves them to separate helper functions. These methods unnecessarily bloat the base classes, and are odd to have when the BasePrimitive doesn't even define a run method to validate. There is no reason primitive implementations need to use the same validation as these base classes either. A follow up will be to remove the validation from the base `run` methods and have subclasses implement their own validation.

* Apply suggestions from code review

* Update qiskit/primitives/base/base_estimator.py

---------

Co-authored-by: Ikko Hamamura <[email protected]>
(cherry picked from commit 05d958b)
@jakelishman jakelishman force-pushed the mergify/bp/stable/0.46/pr-11052 branch from dd27a5e to 89beb83 Compare February 1, 2024 12:57
@mergify mergify bot requested a review from a team as a code owner February 1, 2024 12:57
@jakelishman jakelishman removed the conflicts used by mergify when there are conflicts in a port label Feb 1, 2024
jakelishman
jakelishman previously approved these changes Feb 1, 2024
@jakelishman jakelishman enabled auto-merge February 1, 2024 12:57
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.

get in the queue dammit

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7742504834

  • -10 of 111 (90.99%) changed or added relevant lines in 4 files are covered.
  • 18 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.002%) to 86.911%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/primitives/base/base_sampler.py 5 7 71.43%
qiskit/primitives/base/validation.py 86 88 97.73%
qiskit/primitives/base/base_estimator.py 5 8 62.5%
qiskit/primitives/base/base_primitive.py 5 8 62.5%
Files with Coverage Reduction New Missed Lines %
qiskit/primitives/utils.py 1 87.95%
crates/qasm2/src/lex.rs 5 91.94%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 7741148813: -0.002%
Covered Lines: 75024
Relevant Lines: 86323

💛 - Coveralls

@jakelishman jakelishman added this pull request to the merge queue Feb 1, 2024
Merged via the queue into stable/0.46 with commit 6177feb Feb 1, 2024
13 checks passed
@mergify mergify bot deleted the mergify/bp/stable/0.46/pr-11052 branch February 1, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Deprecation Include in "Deprecated" section of changelog mod: primitives Related to the Primitives module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants