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

improve error on setting shots on new device api #5616

Merged
merged 5 commits into from
May 2, 2024

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented May 1, 2024

Context:

As more devices switch to the new device interface, users may request properties or behaviours that are no longer there. The current error messages do not sufficiently alert users to the fact that the device interface has changed.

Description of the Change:

Make a more informative error when trying to set the shots or access a non-existant attribute.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

Copy link
Contributor

github-actions bot commented May 1, 2024

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.

@albi3ro
Copy link
Contributor Author

albi3ro commented May 1, 2024

[sc-62372]

Copy link

codecov bot commented May 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (v0.36.0-rc0@8fb99cb). Click here to learn what that means.

Additional details and impacted files
@@              Coverage Diff               @@
##             v0.36.0-rc0    #5616   +/-   ##
==============================================
  Coverage               ?   99.69%           
==============================================
  Files                  ?      412           
  Lines                  ?    38312           
  Branches               ?        0           
==============================================
  Hits                   ?    38194           
  Misses                 ?      118           
  Partials               ?        0           

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

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.

This looks good to me 🎉

@albi3ro albi3ro requested a review from a team May 2, 2024 14:20
@albi3ro albi3ro added the merge-ready ✔️ All tests pass and the PR is ready to be merged. label May 2, 2024
Copy link
Contributor

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

Thanks @albi3ro!

pennylane/devices/device_api.py Outdated Show resolved Hide resolved
@albi3ro albi3ro enabled auto-merge (squash) May 2, 2024 17:35
@albi3ro albi3ro merged commit f15151d into v0.36.0-rc0 May 2, 2024
37 checks passed
@albi3ro albi3ro deleted the informative-error-on-setting-shots branch May 2, 2024 18:00
@astralcai astralcai added this to the v0.36 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-ready ✔️ All tests pass and the PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants