-
Notifications
You must be signed in to change notification settings - Fork 633
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
Split AnnotatedQueue
from QueuingContext
#2794
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2794 +/- ##
==========================================
- Coverage 99.67% 99.67% -0.01%
==========================================
Files 272 272
Lines 23133 23122 -11
==========================================
- Hits 23057 23046 -11
Misses 76 76
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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 @albi3ro
Just a quick suggestion, but feel free to ignore if it isn't worth while.
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.
The more I see it the more I like it! These changes really needed to be done!
Amazing job! 💯 🚀
Currently,
QuantumTape
inherits fromAnnotatedQueue
which inherits fromQueuingContext
. This leads to a great deal of confusion about where functionality is defined and what methods are supposed to be doing.This PR does not change any PennyLane behaviour, but just improves internal structure and clarity.
In this PR,
QueuingContext
is no longer an abstract base classAnnotatedQueue
no longer inherits fromQueuingContext
QueuingContext
purely consists of class methods and a private class property.QueuingContext
is no longer a context. It only manages recording contexts. We should later rename it toQueueManager
QueuingContext._active_contexts
is now a list instead of adeque
. Deque was confusing overkill when a list gets the job done perfectly well_append
,_remove
,_get_info
,_update_info
, and_safe_update_info
are removed. They just caused confusing indirection.AnnotatedQueue
andQuantumTape
will no longer provide global information about actively recording queues. This information was unused via those classes and just caused unnecessary duplication.OperationRecorder
are now intests/tape/test_operation_recorder.py
, mirroring the location of the class in the code base.