-
Notifications
You must be signed in to change notification settings - Fork 575
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
Add functionality to qml.transforms.insert #1980
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1980 +/- ##
==========================================
- Coverage 99.17% 99.16% -0.01%
==========================================
Files 218 223 +5
Lines 16665 17090 +425
==========================================
+ Hits 16527 16948 +421
- Misses 138 142 +4
Continue to review full report at Codecov.
|
Hi @trbromley, does this match what you expected? Can you review this? |
Thanks @ankit27kh! We'll take a look through and give some feedback 👍 |
@@ -51,10 +51,11 @@ def test_multiwire_op(self): | |||
with pytest.raises(ValueError, match="Only single-qubit operations can be inserted into"): | |||
insert(qml.CNOT, [])(self.tape) | |||
|
|||
def test_invalid_position(self): | |||
@pytest.mark.parametrize("pos", [1, ["all", qml.RY, int], "ABC", str]) | |||
def test_invalid_position(self, pos): | |||
"""Test if a ValueError is raised when an invalid position is requested""" | |||
with pytest.raises(ValueError, match="Position must be either 'start', 'end', or 'all'"): |
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.
Shouldn't this line change to match the new error message raised by the ValueError (line 222 - 225)
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.
match
is regex-based, and the beginning is the same for both old and new error messages. Thus, I left it as is.
Hey @ankit27kh, looks good! Just a few small comments and this should be good. |
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
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.
Looks good to me!
@antalszava, |
It is being addressed in #2038. |
Hi @ankit27kh it seems that the coverage report check is not passing. Could you confirm that it's a mistake by running |
Hey @antalszava, I ran it locally, and the relevant file is 100% covered. Also, from here, it shows that the file losing coverage is
|
Context:
As discussed in #1876, some quality of life enhancements are made.
Description of the Change:
before
argument can be used to specify whether to insert operation before or afterposition
can now take operations to insert only after specific gatesBenefits:
more functionality
Possible Drawbacks:
none
Related GitHub Issues:
Closes #1876