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

Deprecate MeasurementProcess.return_type and ObservableReturnTypes #6841

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JerryChen97
Copy link
Contributor

@JerryChen97 JerryChen97 commented Jan 15, 2025

Context:
The MeasurementProcess.return_type is only used by the legacy device in a chain of if mp.return_type.name is ... checks that can easily be replaced with isinstance checks.

In PL0.40, return_type is a property of MeasurementProcess which returns None only. Meanwhile, ObservableReturnTypes is an Enum that defines and wraps the name strings, redundantly.

Description of the Change:

  • raise deprecation warnings in return_type.
  • replace legacy device usages of return_type with direct isinstance check
  • unwrap ObservableReturnTypes with direct definitions.

Benefits:
Less redundancies.

Possible Drawbacks:
any downstreaming usage of the deprecations:

  • lightning
  • catalyst
  • qml
  • plugins

Related GitHub Issues:
[sc-71892]

@JerryChen97 JerryChen97 self-assigned this Jan 15, 2025
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.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.

@JerryChen97 JerryChen97 added the deprecation 🗑️ Deprecating an API or user-facing feature/behaviour label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation 🗑️ Deprecating an API or user-facing feature/behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant