-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Very small clean up in the count_ops() method #4002
Conversation
Removed unused line
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, this is a good change and will actually improve performance of the method (doing get is more efficient because it doesn't have to traverse all the keys in the dict to find membership) but it will only probably be noticeable for a large number of different operations. Once you fix the lint errors I think this is good to go
Thank you! I've fixed all the errors except for a single"invalid-file-header" error. I am running this on Windows 10 so I wonder if there is some weirdness going on there. I checked this thread #3127 but I couldn't really resolve the problem. Have you come across this before? |
Hi @mtreinish, hope you had a good weekend! Just wondering if you had a chance to look at my comment above. Thank you! |
@rajkk1 looking at the current version of this branch I do not think you're hitting an environment difference with pylint. The failures with the lint job here are from pycodestyle which does not have the same issues as pylint from that issue. You've removed all the blank lines from the class you were editing and added a blank line to the end. I would recommend reverting those changes on the branch |
This reverts commit 53e86a1.
thank you @mtreinish! I tried reverting and it still wasn't happy. This is getting a bit confusing so I might just re-do the whole pull request to make it easier |
Summary
Very small clean up in the count_ops() method in the QuantumCircuit class. No change in functionality.
Details and comments
The clean up made the code slightly shorter and (in my opinion) slightly more readable. I am working on a different PR and thought of this small optimization so I thought I would create a separate PR for this before submitting my bigger PR. Thanks!