-
Notifications
You must be signed in to change notification settings - Fork 615
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
Fix possibility of falsy zero for work_wires
in templates
#6720
Conversation
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'm wondering if these are worth tests to prevent this mistake from happening again?
work_wires
in qml.templates.subroutines
qml.templates.subroutines
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6720 +/- ##
==========================================
- Coverage 99.62% 99.62% -0.01%
==========================================
Files 476 476
Lines 44740 44733 -7
==========================================
- Hits 44571 44564 -7
Misses 169 169 ☔ View full report in Codecov by Sentry. |
qml.templates.subroutines
work_wires
in qml.templates.subroutines
work_wires
in qml.templates.subroutines
work_wires
in templates
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
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.
LGTM!
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.
🙌
work_wires
in templateswork_wires
in templates
Context:
Follow up to #6713.
Previously,
work_wires=0
was incorrectly being mapped to an empty list,Now, we have it properly handled,
Description of the Change:
Source Code
Change the faulty logic of
work_wires = work_wires or ()
which will fail ifwork_wires=0
.Test Suite
Added tests to templates that allow single work wires, ensuring
work_wires=0
can be passed.Benefits: Fixes possibility of falsy zero logic in
work_wires
.Possible Drawbacks: None.
[sc-80454]