Skip to content

Refresh composites docs#605

Merged
randomir merged 9 commits intodwavesystems:masterfrom
JoelPasvolsky:refresh_composites
Feb 23, 2026
Merged

Refresh composites docs#605
randomir merged 9 commits intodwavesystems:masterfrom
JoelPasvolsky:refresh_composites

Conversation

@JoelPasvolsky
Copy link
Copy Markdown
Contributor

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.98%. Comparing base (8fc5b6a) to head (cff8012).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #605      +/-   ##
==========================================
- Coverage   89.66%   86.98%   -2.69%     
==========================================
  Files          22       22              
  Lines        2013     2013              
==========================================
- Hits         1805     1751      -54     
- Misses        208      262      +54     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@randomir randomir changed the title Refresh composites Refresh composites docs Feb 13, 2026
Copy link
Copy Markdown
Member

@randomir randomir left a comment

Choose a reason for hiding this comment

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

Nice!

Comment on lines +77 to +79
>>> with DWaveSampler() as sampler:
... sampleset = CutOffComposite(AutoEmbeddingComposite(
... sampler), 0.75).sample(bqm, num_reads=1000)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is perfectly fine, but perhaps cleaner (due to all composites implementing Scoped):

Suggested change
>>> with DWaveSampler() as sampler:
... sampleset = CutOffComposite(AutoEmbeddingComposite(
... sampler), 0.75).sample(bqm, num_reads=1000)
>>> with CutOffComposite(AutoEmbeddingComposite(DWaveSampler()), 0.75) as sampler:
... sampleset = sampler.sample(bqm, num_reads=1000)

Actually, even clearer would be to use the cutoff kwarg...

def parameters(self):
"""A dict where keys are the keyword parameters accepted by the sampler methods
and values are lists of the properties relevant to each parameter."""
"""dict: Supported parameters.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps add a type annotation instead of type prefix in the docstring? At least for attributes/properties.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated for new return types

@property
def children(self):
"""List of child samplers that that are used by this composite."""
"""list: Child samplers that that are used by this composite."""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

@randomir randomir merged commit 6cd7e29 into dwavesystems:master Feb 23, 2026
24 checks passed
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.

2 participants