Skip to content

Add support for context manager protocol to all samplers #556

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

randomir
Copy link
Member

Now all of QPU (DWaveSampler, DWaveCliqueSampler), and hybrid (LeapHybrid*Sampler) samplers support .close() and runtime context use.

Close #91.

Composites will be addressed in a follow-up as per #555.

@randomir randomir force-pushed the feature/add-ctx-mgr-support-to-dwavesamplers/issue-91 branch from eda0233 to fabf8ac Compare February 21, 2025 16:05
@randomir randomir force-pushed the feature/add-ctx-mgr-support-to-dwavesamplers/issue-91 branch from fabf8ac to cfb40b2 Compare February 21, 2025 16:08
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 79.48718% with 8 lines in your changes missing coverage. Please review.

Project coverage is 85.40%. Comparing base (46efbe5) to head (3b86960).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
dwave/system/testing.py 52.94% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #556      +/-   ##
==========================================
- Coverage   88.79%   85.40%   -3.40%     
==========================================
  Files          21       21              
  Lines        1669     1692      +23     
==========================================
- Hits         1482     1445      -37     
- Misses        187      247      +60     

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

Copy link
Member

@arcondello arcondello left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@JoelPasvolsky JoelPasvolsky left a comment

Choose a reason for hiding this comment

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

LGTM

@randomir randomir added the feature-request/enhancement New feature or request label Feb 21, 2025
@randomir randomir merged commit 77392d7 into dwavesystems:master Feb 24, 2025
20 checks passed
@randomir randomir deleted the feature/add-ctx-mgr-support-to-dwavesamplers/issue-91 branch February 24, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turn DWaveSampler into context manager
3 participants