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

Fix bad deprecation of Register.name_format #9494

Merged
merged 5 commits into from
Jan 31, 2023

Conversation

jakelishman
Copy link
Member

Summary

This inadvertantly made the class attribute accessible only from instances. It's no use for this to only be on instances, since you historically needed to validate against the regex to be sure the instance initialisation would succeed.

Details and comments

Fix #9493

This inadvertantly made the class attribute accessible only from
instances.  It's no use for this to only be on instances, since you
historically needed to validate against the regex to be sure the
instance initialisation would succeed.
@jakelishman jakelishman added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: Bugfix Include in the "Fixed" section of the changelog labels Jan 31, 2023
@jakelishman jakelishman added this to the 0.23.1 milestone Jan 31, 2023
@jakelishman jakelishman requested a review from a team as a code owner January 31, 2023 13:47
@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

The positive interaction between `classmethod` and `property` was
apparently only added in Python 3.9.
@coveralls
Copy link

coveralls commented Jan 31, 2023

Pull Request Test Coverage Report for Build 4056096435

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 85.257%

Files with Coverage Reduction New Missed Lines %
src/sabre_swap/layer.rs 2 98.95%
Totals Coverage Status
Change from base Build 4055828274: 0.03%
Covered Lines: 67026
Relevant Lines: 78616

💛 - Coveralls

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

The fix itself LGTM, just a couple comments in the release note.

jakelishman and others added 2 commits January 31, 2023 15:16
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
@mergify mergify bot merged commit 06f5ac1 into Qiskit:main Jan 31, 2023
mergify bot pushed a commit that referenced this pull request Jan 31, 2023
* Fix bad deprecation of Register.name_format

This inadvertantly made the class attribute accessible only from
instances.  It's no use for this to only be on instances, since you
historically needed to validate against the regex to be sure the
instance initialisation would succeed.

* Use custom descriptor instead of classmethod/property

The positive interaction between `classmethod` and `property` was
apparently only added in Python 3.9.

* Fixup release note

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 06f5ac1)
@jakelishman jakelishman deleted the fix/Register.name_format branch January 31, 2023 17:20
mergify bot added a commit that referenced this pull request Jan 31, 2023
* Fix bad deprecation of Register.name_format

This inadvertantly made the class attribute accessible only from
instances.  It's no use for this to only be on instances, since you
historically needed to validate against the regex to be sure the
instance initialisation would succeed.

* Use custom descriptor instead of classmethod/property

The positive interaction between `classmethod` and `property` was
apparently only added in Python 3.9.

* Fixup release note

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 06f5ac1)

Co-authored-by: Jake Lishman <jake@binhbar.com>
pranay1990 pushed a commit to pranay1990/qiskit-terra that referenced this pull request Feb 9, 2023
* Fix bad deprecation of Register.name_format

This inadvertantly made the class attribute accessible only from
instances.  It's no use for this to only be on instances, since you
historically needed to validate against the regex to be sure the
instance initialisation would succeed.

* Use custom descriptor instead of classmethod/property

The positive interaction between `classmethod` and `property` was
apparently only added in Python 3.9.

* Fixup release note

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Register.name_format inaccessible as class property during deprecation
4 participants