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

do not use measurementprocess.name #605

Merged
merged 4 commits into from
Feb 1, 2024
Merged

do not use measurementprocess.name #605

merged 4 commits into from
Feb 1, 2024

Conversation

timmysilv
Copy link
Contributor

@timmysilv timmysilv commented Jan 31, 2024

Context:
MeasurementProcess.name has been deprecated, and we should avoid using it. Unfortunately, sometimes they disguise as observables. This is one of those times, and it makes PennyLane CI fail when we enable deprecation-warnings-as-errors

Description of the Change:
Just use isinstance to not check the name in case it's not an observable.

Benefits:

  • No more deprecation warnings!
  • my PR is unblocked 😄

Possible Drawbacks:
N/A

Related GitHub Issues:
PennyLaneAI/pennylane#5122, recently introduced in #601

Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cfe2455) 98.68% compared to head (e284767) 98.68%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #605      +/-   ##
==========================================
- Coverage   98.68%   98.68%   -0.01%     
==========================================
  Files         168      169       +1     
  Lines       24191    24344     +153     
==========================================
+ Hits        23874    24023     +149     
- Misses        317      321       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

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

Looks good to me, happy to approve & merge once the CI goes green!

Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

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

Thank you for that!

@AmintorDusko AmintorDusko merged commit f3beabc into master Feb 1, 2024
83 of 84 checks passed
@AmintorDusko AmintorDusko deleted the avoid-mp-name branch February 1, 2024 13:07
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.

3 participants