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

legacy device: check if object is measurement before checking stopping_condition #5071

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

timmysilv
Copy link
Contributor

Context:
Many plugins are failing because of the deprecation of MeasurementProcess.name (#5047). The old device API checks if an object meets the stopping requirement or if it's a measurement (in that order). Due to this ordering, we reference mp.name which is now deprecated.

Description of the Change:
Swap the order of conditions in _local_tape_expand to avoid hitting this deprecation warning

Benefits:
Plugins will work again!

Possible Drawbacks:
N/A

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c01cb4b) 99.67% compared to head (cbadb09) 99.66%.
Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5071      +/-   ##
==========================================
- Coverage   99.67%   99.66%   -0.01%     
==========================================
  Files         394      394              
  Lines       35670    35428     -242     
==========================================
- Hits        35554    35310     -244     
- Misses        116      118       +2     

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

@timmysilv timmysilv requested a review from a team January 16, 2024 19:50
Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

🚀

@lillian542 lillian542 requested a review from a team January 16, 2024 20:35
Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

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

Love it when its such an easy fix :)

@timmysilv timmysilv merged commit 68a1edd into master Jan 16, 2024
35 checks passed
@timmysilv timmysilv deleted the check-is-mp-first branch January 16, 2024 21:31
timmysilv added a commit that referenced this pull request Jan 17, 2024
Same as #5071 but in other places.

I'm a little worried that maybe we shouldn't deprecate
`MeasurementProcess.name` at all... seems like we kinda depend on it? My
first thought was to just make them more correct (eg. "State", "Probs"),
but I don't think any devices have those saved in their
`dev.observables` so I suppose this might still be the best way forward
mudit2812 pushed a commit that referenced this pull request Jan 19, 2024
…g_condition (#5071)

**Context:**
Many plugins are failing because of the deprecation of
`MeasurementProcess.name` (#5047). The old device API checks if an
object meets the stopping requirement _or_ if it's a measurement (in
that order). Due to this ordering, we reference `mp.name` which is now
deprecated.

**Description of the Change:**
Swap the order of conditions in `_local_tape_expand` to avoid hitting
this deprecation warning

**Benefits:**
Plugins will work again!

**Possible Drawbacks:**
N/A
mudit2812 pushed a commit that referenced this pull request Jan 19, 2024
Same as #5071 but in other places.

I'm a little worried that maybe we shouldn't deprecate
`MeasurementProcess.name` at all... seems like we kinda depend on it? My
first thought was to just make them more correct (eg. "State", "Probs"),
but I don't think any devices have those saved in their
`dev.observables` so I suppose this might still be the best way forward
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