-
Notifications
You must be signed in to change notification settings - Fork 1
Fix some pyright issues #163
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
Conversation
For the CU3 bug, would you mind also adding unit tests for one of the angle to be zero? |
Oh, CI fails because I added a method |
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 but I think we might have some issues with the implementation in some areas not just linting.
origin_qubits = tuple( | ||
[frame.get(input_elem).origin_qubit for input_elem in stmt.inputs] | ||
[ | ||
frame.get_casted(input_elem, AddressWire).origin_qubit | ||
for input_elem in stmt.inputs | ||
] | ||
) | ||
new_address_wires = tuple( | ||
[AddressWire(origin_qubit=origin_qubit) for origin_qubit in origin_qubits] |
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 is also wrong you should just return all the values from the frame because there is no dependency on what the value is.
return frame.get_values(stmt.inputs)
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.
@johnzl-777 how about this one?
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 talked to @johnzl-777 in person, he is OK with this change.
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.
Changed it!
Co-authored-by: Phillip Weinberg <[email protected]>
Noticed in QuEraComputing/bloqade-circuit#163 that this is useful for linting, but also just for shortening code here and there. I also replaced code that raises a `ValueError` if the result from `get_trait` is `None` here (2nd commit).
Noticed in QuEraComputing/bloqade-circuit#163 that this is useful for linting, but also just for shortening code here and there. I also replaced code that raises a `ValueError` if the result from `get_trait` is `None` here (2nd commit).
fyi. QuEraComputing/kirin#370 is in v0.16.7 now |
test failure seems due to a simple typo |
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
bump @weinbe58 for a review. |
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
Got it down to 14 errors (starting out with 69). Not sure if all changes make sense.
The errors that are left are mostly ones such as this:
I'm not sure what the best way to deal with those method overrides is.
Also, there's still a bunch of errors in
visual/animation
, which I could fix, but it would require some type assertions here and there (i.e. actually raising an error if the type expectation is not met) and I didn't want to go and break @kaihsin animation scripts.We can discuss & continue here, or just merge (if the changes are fine) and continue in a separate PR, since this already improves things a bit.