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
Implement custom comparison for ControlledSequence #4829
Implement custom comparison for ControlledSequence #4829
Conversation
add changelog entry for these changes
Hi! I have based this PR on an older commit 970d30c (from 26.10) since the newest commit was throwing some import errors when I pulled from master, and this was one of the last ones were the CI checks were passing. I see the only conflict is with the changelog, so hopefully doing it this way was ok :) Let me know what you think about my changes! |
Hello @EmilianoG-byte , thanks for your contribution! I will give an initial review of your PR this afternoon. |
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.
Thank you @EmilianoG-byte your PR looks good 💯 I have left some comments.
Concerning your import issue, I think it might be that we added pytest-benchmark
mandatory to run the tests suite, you should pip install the package and let us know if the issue persists.
Co-authored-by: Romain Moyard <rmoyard@gmail.com>
Co-authored-by: Romain Moyard <rmoyard@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4829 +/- ##
==========================================
- Coverage 99.66% 99.65% -0.01%
==========================================
Files 382 382
Lines 34465 34211 -254
==========================================
- Hits 34348 34093 -255
- Misses 117 118 +1 ☔ View full report in Codecov by Sentry. |
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.
This looks good @EmilianoG-byte, thanks for the thorough tests! 🚀
Thank you 😃 @lillian542 !! |
Hi @rmoyard, I made the changes we discussed 😊 |
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.
Thanks for the PR 💯
thank you @rmoyard and @lillian542! Two final things: 2- Any thoughts on my comment regarding the parametrisation of the first functions? In general, I wanted to know if using pytest @pytest.mark.parametrize("test_class", [Controlled, ControlledSequence]) |
Hi @EmilianoG-byte, I am glad you solved the issue! For the second part, in general you are welcome to use it but I also like when it is tested separated. It makes it easier to refactor if needed. |
Awesome! Thank you so much @EmilianoG-byte. Merging this now 😎 |
Thank you @Alex-Preciado 😄 |
Context:
Currently,
qml.equal
does not have a registered function that compares twoControlledSequence
objects correctly. This PR addresses this issue.Description of the Change:
Registers a new overloaded implementation of
_equal
for arguments of typeControlledSequence
. For two objects of this type,qml.equal
compares if:For example:
Benefits:
Correct comparison of two
ControlledSequence
objects is now possible.Possible Drawbacks:
None.
Related GitHub Issues:
Closes: #4797