Skip to content
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 qml.capture.pause #6911

Merged
merged 7 commits into from
Feb 4, 2025
Merged

Add qml.capture.pause #6911

merged 7 commits into from
Feb 4, 2025

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Jan 31, 2025

Context:

I was getting annoyed by all the times I was doing:

disable():
try:
    # some code
finally:
    enable()

Description of the Change:

Adds qml.capture.stop_recording()

Benefits:

I get less annoyed. Also, code might be more clean and readable.

Possible Drawbacks:

Related GitHub Issues:

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.59%. Comparing base (8cefc9a) to head (a823f80).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6911   +/-   ##
=======================================
  Coverage   99.59%   99.59%           
=======================================
  Files         480      480           
  Lines       45474    45495   +21     
=======================================
+ Hits        45289    45310   +21     
  Misses        185      185           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mudit2812 mudit2812 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome, just a couple of questions

pennylane/capture/switches.py Outdated Show resolved Hide resolved
pennylane/devices/qubit/dq_interpreter.py Outdated Show resolved Hide resolved
@albi3ro albi3ro requested a review from mudit2812 February 4, 2025 15:55
@albi3ro albi3ro changed the title Add qml.capture.stop_recording Add qml.capture.pause Feb 4, 2025
Copy link
Contributor

@andrijapau andrijapau left a 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!

@albi3ro albi3ro enabled auto-merge February 4, 2025 19:56
@albi3ro albi3ro added this pull request to the merge queue Feb 4, 2025
@rashidnhm rashidnhm removed this pull request from the merge queue due to the queue being cleared Feb 4, 2025
@albi3ro albi3ro enabled auto-merge (squash) February 4, 2025 22:32
@albi3ro albi3ro merged commit be3ae76 into master Feb 4, 2025
46 checks passed
@albi3ro albi3ro deleted the pause-capture-context branch February 4, 2025 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants