Skip to content

fix: Remove use of MeasurementProcess.return_type#288

Merged
rmshaffer merged 2 commits intoamazon-braket:mainfrom
albi3ro:remove-old-return-types2
May 2, 2025
Merged

fix: Remove use of MeasurementProcess.return_type#288
rmshaffer merged 2 commits intoamazon-braket:mainfrom
albi3ro:remove-old-return-types2

Conversation

@albi3ro
Copy link
Copy Markdown
Contributor

@albi3ro albi3ro commented Apr 29, 2025

Issue #, if available:

See Issue #289

Description of changes:

MeasurementProcess.return_type and the associated ObservableReturnType enum was deprecated in pennylane v0.41 and has now been removed in latest PennyLane. This PR updates the plugin to use the recommended isinstance checks instead of checking the removed return_type property.

Testing done:

I ran all but the test_ops.py unit tests locally. The required version of tensorflow was for test_ops.py was not available for my mac.

But other than that, the test seem fine with pennylane master installed.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@albi3ro albi3ro requested a review from a team as a code owner April 29, 2025 18:05
@rmshaffer rmshaffer changed the title Remove use of MeasurementProcess.return_type fix: Remove use of MeasurementProcess.return_type May 1, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented May 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b578a4c) to head (94fa03d).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #288   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines         1244      1245    +1     
  Branches       161       162    +1     
=========================================
+ Hits          1244      1245    +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rmshaffer rmshaffer self-assigned this May 1, 2025
@speller26 speller26 linked an issue May 1, 2025 that may be closed by this pull request
@rmshaffer rmshaffer merged commit c34853a into amazon-braket:main May 2, 2025
20 checks passed
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.

Remove use of deprecated MeasurementProcess.return_type

2 participants