-
Notifications
You must be signed in to change notification settings - Fork 40
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
Use isinstance(op, qml.Op)
instead of operation.name string comparison in Python interfaces
#691
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #691 +/- ##
==========================================
- Coverage 98.67% 98.67% -0.01%
==========================================
Files 174 174
Lines 22625 22624 -1
==========================================
- Hits 22326 22325 -1
Misses 299 299 ☔ View full report in Codecov by Sentry. |
070f293
to
f542a7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good so far.
Do you have any idea why some CIs are failing?
I think it is just the usual: some wheel building failing and needs restart, codecov prematurely reporting before all Linux tests are over. I'll monitor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, in terms of coding and general testing, your PR looks pretty good.
I will approve now, let me know if you need any help with the falling CIs.
Before submitting
Please complete the following checklist when submitting a PR:
All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to the
tests
directory!All new functions and code must be clearly commented and documented.
If you do make documentation changes, make sure that the docs build and
render correctly by running
make docs
.Ensure that the test suite passes, by running
make test
.Add a new entry to the
.github/CHANGELOG.md
file, summarizing thechange, and including a link back to the PR.
Ensure that code is properly formatted by running
make format
.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Context:
There are several places in Python interfaces that we use string comparison for comparing PL operations and observables.
String comparison is usually considered a bad practice in compare with using
isinstance(object, class_type)
in Python.Description of the Change:
Use
isinstance
where possible.Benefits:
Possible Drawbacks:
Related GitHub Issues:
[sc-58642]